Article ID: 197883
Article Last Modified on 4/22/2003
Set rdoRes = rdoConn.OpenResultset("select * from Nwind where
s_guid={guid{9B83B027-E038-11D1-847E-00C04FB1784E}}", _
rdOpenKeyset, rdConcurLock, rdAsyncEnable)
The following error occurs:
Notice that all of the curly braces have been stripped off except the last
one.
Private Sub Command1_Click()
Dim rdoConn As rdoConnection
Dim rdoRes As rdoResultset
Dim strguid As String
'Make sure that you are pointing to a valid DSN and a replicated
'database.
Set rdoConn = rdoEnvironments(0).OpenConnection("", _
rdDriverNoPrompt, _
False, "DRIVER={Microsoft Access Driver (*.mdb)};" & _
"dsn=acc2;UID=admin;PWD=;")
'Change this so that it points to a valid GUID in your replicated
'database.
strguid = "{guid {9B83B027-E038-11D1-847E-00C04FB1784E}}"
'Comment this line and you will see the previously noted error.
SQLSetConnectOption rdoConn.hdbc, SQL_NOSCAN, SQL_NOSCAN_ON
Set rdoRes = rdoConn.OpenResultset("select * from customers " & _
"where s_guid = " & strguid, rdOpenKeyset, rdConcurLock)
Debug.Print rdoRes!CompanyName
rdoRes.Close
rdoConn.Close
End Sub
Option Explicit
Public Const SQL_NOSCAN = 2
Public Const SQL_NOSCAN_OFF = 0
Public Const SQL_NOSCAN_ON = 1
Declare Sub SQLSetConnectOption Lib "odbc32.dll" (ByVal hdbc As Long,
ByVal p1 As Long, ByVal p2 As Long)
170117 HowTo: Use GUID Fields in Access from Visual C++
Keywords: kbrdo kbprb KB197883