troubleshooting Question

pause code in sql2008 through Access07

Avatar of Kongta
KongtaFlag for Switzerland asked on
Microsoft AccessMicrosoft SQL Server 2008
12 Comments1 Solution265 ViewsLast Modified:
I do have a code that executes Stored Procedures instructed in Access07 step by step. This all worked fine with SQL2000, but I now would like to have same with SQL2008. the problem now is, that it goes through SP-Executing withouth waiting a SP is finished and therefore, a later SP will be executed withouth having the newest data and will then bring old/wrong results. How can I implement that it waits till SP-executing is finished before executing the next one? Can I implement a pause-code?
thx and merry x-mas
Kongta
Me.frmKursupdate_StatusInfo = "Uebertrag in DB...."
Me.FX_Anzeige.ForeColor = RGB(255, 200, 100)
DoEvents

Set c = New ADODB.Connection
c.ConnectionString = "Driver={SQL Server};Server=" & Srv & ";Database=" & DB & ""
c.Open

Set cmd = New ADODB.Command

With cmd
    .ActiveConnection = c
    .CommandText = "sp_DTS_xls_FX"
    .CommandType = adCmdStoredProc
    .CommandTimeout = 0
    
    .Execute
End With

c.Close
Set c = Nothing
Set cmd = Nothing

Me.frmKursupdate_StatusInfo = "....erfolgreich."
Me.FX_Anzeige.ForeColor = RGB(100, 255, 100)
DoEvents
'------------------------------------------------------------------------------

'Uebertraegt tblIndex-------------------------------------

Me.frmKursupdate_StatusInfo = "Uebertrag tblIndex...."
Me.Index_Anzeige.ForeColor = RGB(255, 200, 100)
DoEvents

Set c = New ADODB.Connection
c.ConnectionString = "Driver={SQL Server};Server=" & Srv & ";Database=" & DB & ""
c.Open

Set cmd = New ADODB.Command

With cmd
    .ActiveConnection = c
    .CommandText = "sp_DTS_xls_Index"
    .CommandType = adCmdStoredProc
    .CommandTimeout = 0
    
    .Execute
End With

c.Close
Set c = Nothing
Set cmd = Nothing

Me.frmKursupdate_StatusInfo = "....erfolgreich."
Me.Index_Anzeige.ForeColor = RGB(100, 255, 100)
DoEvents
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 12 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros