Mike & Doris Manning
mikedorism at verizon.net
Fri Mar 10 10:22:56 CST 2006
Here are my favorite website for sharing with ADO newbies...
http://authors.aspalliance.com/aspxtreme/ado/index.aspx
http://www.connectionstrings.com
Doris Manning
mikedorism at verizon.net
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bud Goss
Sent: Friday, March 10, 2006 9:58 AM
To: Access Group
Subject: [AccessD] ADO recordsets and connection objects
I am trying to learn the basics of ADO recordsets and connections.
So far, I have been unable to get to first base. The two methods listed
below give me the following error:
Run-time error'-2147467259(80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no
default driver specified
First attempt with udl file:
Public Sub MyADOTest01()
Dim rec As ADODB.Recordset
Set rec = New ADODB.Recordset
rec.Open "Select * from [Orders] ", "File Name = C:\B\A\x.udl"
rec.CursorLocation = adUseClient
rec.LockType = adlockBatchOptimistic
MsgBox "OPEN HAS OCCURED " & rec!Customer
End Sub
Second attempt without udl file"
Public Sub MyADOTest02()
Dim rec As ADODB.Recordset
Set rec = New ADODB.Recordset
rec.Open "Select * from [Orders]", "File Name = C:\B\A\Northwind.mdb"
rec.CursorLocation = adUseClient
rec.LockType = adlockBatchOptimistic
MsgBox "OPEN HAS OCCURED " & rec!Customer
rec.activeconnection.Close
End Sub
C:\B\A\ .. Contains x.udl and Northwind.mdb
x.udl points to C:\B\A\Northwind.mdb and has MicrosoftJet 4.0 OLE Provider
specified
Subs are contained in another Access 2003 database that is located in
C:\B\A_Access_Tr
This database does have the reference
Microsoft ActiveX data Objects 2.1 Llibrary
Any help would be appreciated.
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com