Im getting an error on the Line
The error reads "Variable Not Defined" but I've used this same code on 10 or so different projects and NEVER had a problem before...VB Code:
Set datPrimaryRS = New ADODB.Recordset
What gives?
VB Code:
Dim sConnect As String Dim sSQL As String Dim dfwConn As ADODB.Connection ' set strings sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Referral\Referral Rebuild\referrals.mdb;Persist Security Info=False" sSQL = "select DrID, SpecialistType, SpecialistLastName, SpecialistFirstName, Address, Fax, Phone, Remarks from Specialists where SpecialistLastName like '" & Text8.Text & "'" ' open connection Set dfwConn = New ADODB.Connection dfwConn.Open sConnect ' create a recordset using the provided collection Set datPrimaryRS = New ADODB.Recordset datPrimaryRS.CursorLocation = adUseClient datPrimaryRS.Open sSQL, dfwConn, adOpenForwardOnly, adLockReadOnly Set MSHFlexGrid1.DataSource = datPrimaryRS MSHFlexGrid1.Refresh Text9.Text = datPrimaryRS![SpecialistFirstName] Text10.Text = datPrimaryRS![SpecialistType]




Reply With Quote