VB ADO with ODBC - Problems

Garyk

New Member
I have been writing a fairly large VB application which connects to Progress on a Solaris server. I'm using the Merant ODBC client that comes with Progress. In VB I do my work with ADO to ODBC. I have found the results VERY inconsistent! Static recordsets get all the records, however give strange errors at times when trying to write to the database. Keyset recordsets writes to the DB where Static won't. But Keyset only gets one record simetimes two! When I use ADO to work with the local Access mdb, I don't have any of these issues.

Is anyone else trying to do any of these operations?
If so what are your experiences?

Gary...
 
H

hexodeci

Guest
Maybe This will help you.

Have you heard of such a thing as Automatic error prevention/error detection tools?

It does white box testing, black box testing and regression testing as well as regression testing. And static Analysis.

It may help you.
 

Garyk

New Member
I have heard of error detection tools, but that's about it. I really think that this is a bug in the Merant / Progress connection. I don't know which one or both may be at fault.
Can this kind of tool help find out who is at fault? Would you recommend a particular tool that would help?
I have downloaded Merant's sequeLink and this does not seem to have the same problems. Without changing the VB code, I just used their connection and the problems that I tested went away.

Thanks,
Gary...
 
F

Felix Chan

Guest
You are lucky than me. I cannot even write data to a Progress database at Solaris from my VB applications. The Progress manul says that a I need to set a unique key for my table and I did that. If I link the table from Access 97, I can read/update/insert data as usual. But when I open the table with ADO in my VB program, I cannot update the data. It drives me crazy.

How did you write data to the Progress from VB ? I am using the product known as Merant ODBC Progress Driver v 3.6

Thank you very much
 

Garyk

New Member
1) Get something like WinSQL (www.indus-soft.com) and make sure that you can browse the DB manually.
2) Under your Data sources in the control panel, turn tracing in and run a test program. Very often this file will contain the "REAL" error which does not get passed back to VB.

Here is a sample VB update routine.


Public Sub reload_employee()
Dim emp As New ADODB.Recordset '<== Progress Solaris DB
Dim ss_emp As New ADODB.Recordset '<== Local Access DB

Dim sql_cmd As String
Dim inp_line As String, ins_rec As String
Dim entry() As String
Dim Num_Records As Long

On Error GoTo reload_employee_Error '---- Error Handler

do_alert "Delete Old"

' Select the data.
sql_cmd = "DELETE * FROM employee"

' Get the records.
Set rs = conn.Execute(sql_cmd, , adCmdText)

do_alert "Get updates from server"

sql_cmd = "SELECT clock,emp_id,first_name,last_name " _
& " FROM PUB.time_emp"

emp.CursorType = adOpenForwardOnly
emp.LockType = adLockReadOnly
emp.Open sql_cmd, conn_prod_time, , , adCmdText

ss_emp.CursorType = adOpenForwardOnly
ss_emp.LockType = adLockOptimistic
ss_emp.Open "employee", conn, , , adCmdTable

do_alert "Update Local database"

Do While Not emp.EOF
ss_emp.AddNew
ss_emp!clock_no = emp!clock
ss_emp!emp_id = emp!emp_id
ss_emp!full_name = emp!first_name & " " & emp!last_name
ss_emp.Update

emp.MoveNext
' DoEvents ' Yield to other processes.
Loop
emp.Close
ss_emp.Close

On Error GoTo 0
Exit Sub

reload_employee_Error:
Put_Err_Msg "", "Procedure reload_employee of Module Module1"

End Sub
 
Top