G
George
Hi to everybody....(sorry fore the code example...i assume that it will make
understanding easier)
I have an application in Access97 wich is connected
via ODBC to a SQL-Server 7.0 Database (the tables are linked)
My problem is that if i make a call to a stored procedure (to add f.e some
data to a table)
within a WorkSpace and then trying to open a recordset,to the same
table,within the same workspace,
i get the message (after 60sec) "ODBC-Call failed".(I know that 60 sec are
the ODBC time out.)
The same 'thing' works perfect IF the database is a standard .mdb file.
My question is:
Why can't i open a recordset to a table, when few lines before,
a stored procedure is called to make some changes to the same table
(always within the same Workspace) when i am connected via ODBC to the
Database ???
Is there any way to resolve this?
Example Code:
============================================================================
===============================
On Error GoTo errZ
Dim myws As Workspace, mydb As Database, mydef As QueryDef
Dim myset1 As Recordset, myset2 As Recordset, mysql As String
Set myws = DBEngine.Workspaces(0)
myws.BeginTrans
mysql = "sp_insert_TABLE1 'George'"
Set mydb = CurrentDb()
Set mydef = mydb.CreateQueryDef("")
mydef.ReturnsRecords = True
mydef.Connect = "ODBC;DATABASE=unidata;UID=sa;PWD=;DSN=unidata"
mydef.SQL = mysql
Set myset1 = mydef.OpenRecordset() 'execute the stored
procedure
Set myset2 = mydb.OpenRecordset("table1", dbOpenDynaset,
dbSeeChanges) '**here the code fails**
myws.CommitTrans
Exit Sub
errZ_nxt:
myws.Rollback
Exit Sub
errZ:
If Err = 3325 Then 'Error handling of ...."Pass_through Query did not
return any records...."
Resume Next
Else
MsgBox Error$ & Err
Resume errZ_nxt
End If
============================================================================
===============================
I appreciate any help......
Many Thanks in advance!!!
George!
understanding easier)
I have an application in Access97 wich is connected
via ODBC to a SQL-Server 7.0 Database (the tables are linked)
My problem is that if i make a call to a stored procedure (to add f.e some
data to a table)
within a WorkSpace and then trying to open a recordset,to the same
table,within the same workspace,
i get the message (after 60sec) "ODBC-Call failed".(I know that 60 sec are
the ODBC time out.)
The same 'thing' works perfect IF the database is a standard .mdb file.
My question is:
Why can't i open a recordset to a table, when few lines before,
a stored procedure is called to make some changes to the same table
(always within the same Workspace) when i am connected via ODBC to the
Database ???
Is there any way to resolve this?
Example Code:
============================================================================
===============================
On Error GoTo errZ
Dim myws As Workspace, mydb As Database, mydef As QueryDef
Dim myset1 As Recordset, myset2 As Recordset, mysql As String
Set myws = DBEngine.Workspaces(0)
myws.BeginTrans
mysql = "sp_insert_TABLE1 'George'"
Set mydb = CurrentDb()
Set mydef = mydb.CreateQueryDef("")
mydef.ReturnsRecords = True
mydef.Connect = "ODBC;DATABASE=unidata;UID=sa;PWD=;DSN=unidata"
mydef.SQL = mysql
Set myset1 = mydef.OpenRecordset() 'execute the stored
procedure
Set myset2 = mydb.OpenRecordset("table1", dbOpenDynaset,
dbSeeChanges) '**here the code fails**
myws.CommitTrans
Exit Sub
errZ_nxt:
myws.Rollback
Exit Sub
errZ:
If Err = 3325 Then 'Error handling of ...."Pass_through Query did not
return any records...."
Resume Next
Else
MsgBox Error$ & Err
Resume errZ_nxt
End If
============================================================================
===============================
I appreciate any help......
Many Thanks in advance!!!
George!