I'm building a database app w/ bound controls (no ado data control) and I can't connect to an Access database. I get the error of "Expected function or variable". I triple checked my work but I spelled all of my variables the same. When I do get the error, it highlights the open method of my connection object. The following is the code:
Option Explicit
Dim mcnAP As Connection
Dim mrsVendors As Recordset
Private Sub Form_Load()
Set mcnAP = New Connection
Set mrsVendors = New Recordset
mcnAP.CursorLocation = adUseClient
mcnAP.Open = "Provider=Microsoft.Jet.OLEDB.3.51;" & _
"Data Source=A:\Chapter6Bound\AccountsPayable.mdb"
mrsVendors.Open "Select * From Vendors Order By
VendorName", _
mcnAP, adOpenStatic, adLockOptimistic, adCmdText
LoadControls
SetNavigationButtons True
End Sub
Anyone see anything wrong w/ this code? Thx.