app crash

Danny Lewkin daniel.lewkin at cognosis.be
Fri Feb 1 07:24:54 CST 2008


Hi List,

in my RB code, i have a finction to create a local db with a stored  
procedure in it...

   Dim f As FolderItem
   Dim test As Integer
   Dim strQuery As String

   f = PreferencesFolder.Child("pbConn.vdb")
   try
     MyConnectionDB.Create(f, EVDbMode.kDscDatBlbInd)
     'MyConnectionDB.Open(f)

     call MyConnectionDB.CreateTable("tbl_connection")


     call MyConnectionDB.Table("tbl_connection").CreateVarCharField 
("company_name",200, EVFlag.fUnique)
     call MyConnectionDB.Table("tbl_connection").CreateVarCharField 
("location", 2000)
     call MyConnectionDB.Table("tbl_connection").CreateVarCharField 
("settings_path",300)
     call MyConnectionDB.Table("tbl_connection").CreateBooleanField 
("last_connected")

     MyConnectionDB.Flush

     strQuery = "create or replace procedure conn_listconnections()  
begin "
     strQuery = strQuery + "SELECT RecID, company_name, location,  
settings_path, last_connected FROM tbl_connection ORDER BY  
company_name; "
     strQuery = strQuery + "END;"
     call MyConnectionDB.SqlExecute(strQuery)

   Catch Err As VException
     MsgBox("The connectionstable could not be created because:" +  
GetMessage(StaticModule.zMessages.kNoMessage, Err) + EndOfLine + "The  
Application will shut down.")
     Quit()
   end try

The problem is this:

When I call this SP, conn_listconnections(), the first time,  
everything goes well, no problems...

This is the call :


   try
     strQuery = "CALL conn_listconnections()"
     MyCursor = new VCursor(MyConnectionDB, strQuery,  
EVCursorLocation.kClientSide, EVLockType.kNoLocks,  
EVCursorDirection.kForwardOnly)

When I call this procedure AFTER I deleted, changed, or added a  
record, my app crashes. No idea why...
I have a try-catch Vexception, but even in debug, the app crashes  
when it tries to create the cursor.

The thing now is, that in my code, I changed the call of the SP 
(strQuery), to the sql_query of the SP (so strQuery = "SELECT RecID,  
company_name, location, settings_path, last_connected FROM  
tbl_connection ORDER BY company_name; ").
  I exactly copy_pasted the query, so everything would 100% be the  
same...

And guess what...

It doesn't crash anymore...;-)

Any idea's what's going on?

Greetz,

Danny


More information about the Valentina mailing list