View Single Post
  #6 (permalink)  
Old 06-14-2008, 07:07 PM
Erel's Avatar
Erel Erel is offline
Administrator
 
Join Date: Apr 2007
Posts: 3,132
Default

This error (which is not related to the new version) will only happen if you don't show any form.
You can fix it by explicitly disposing of the command and connection objects:
Code:
Sub App_Start
    Con.New1
    Cmd.New1("",con.Value)
    Con.Open("Data Source = " & AppPath & "\Northwind.sl3")
    Text="CREATE TABLE if not exists table1 (col1,col2)"
    cmd.CommandText=Text
    cmd.ExecuteNonQuery
    
    cmd.AddParameter("value1")
    cmd.AddParameter("value2")
    cmd.CommandText = "INSERT INTO [table1] (col1,col2) VALUES (@value1,@value2)"
    Con.BeginTransaction
    cmd.SetParameter("value2","SomeValue")
    For i = 0 To 10
        cmd.SetParameter("value1",i * 2)
        cmd.ExecuteNonQuery
    Next
    Con.EndTransaction
    Con.Close
     cmd.Dispose
    Con.Dispose
End Sub
Reply With Quote