Hallo,
Please could anyone tell me what the following highligted in red codes means;
Option Compare Database
Option Explicit
Public qDF As QueryDef
Set qDF = cON.CreateQueryDef("", strSQL)
Set rST2 = qDF.OpenRecordset()
This code is inserted within an ODBC connection as shown below. I want to trace the reason of the connection and what is it linking too.. Am I looking on the right place?
Thanks for any suggections..
Please could anyone tell me what the following highligted in red codes means;
Option Compare Database
Option Explicit
Public qDF As QueryDef
Set qDF = cON.CreateQueryDef("", strSQL)
Set rST2 = qDF.OpenRecordset()
This code is inserted within an ODBC connection as shown below. I want to trace the reason of the connection and what is it linking too.. Am I looking on the right place?
Code:
Sub FetchPatInfo()
'this converts the pateids into a full patient list
Dim i As Integer
strSQL = lblSQL.Caption & " (" & txtCodes & ")"
Set dBS = DBEngine(0)(0)
dBS.Execute "DELETE tblImportPatients.* FROM tblImportPatients"
Set wRK = CreateWorkspace("", "maintain", "maintain99", dbUseODBC)
Set cON = wRK.OpenConnection("odsaccess", , , "ODBC;")
cON.QueryTimeout = 0
[COLOR=red]Set qDF = cON.CreateQueryDef("", strSQL)
[/COLOR]
Set rST1 = dBS.OpenRecordset("select * from tblImportPatients", dbOpenDynaset)
[COLOR=red]Set rST2 = qDF.OpenRecordset()[/COLOR]
Dim LdRef As Long
LdRef = DMax("LoadRef", "tblDuplicateData")
While Not rST2.EOF
rST1.AddNew
For i = 0 To rST2.Fields.Count - 1
rST1.Fields(i) = rST2.Fields(i)
rST1.Fields(7) = LdRef
Next
rST1.Update
rST2.MoveNext
Wend
rST1.Close
rST2.Close
cON.Close
wRK.Close
Set dBS = Nothing
Beep
End Sub
Thanks for any suggections..