View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jean-Yves[_2_] Jean-Yves[_2_] is offline
external usenet poster
 
Posts: 253
Default ADODB Connection Problem

Hi,

did you check if there is no missing libraray. Ref to ADO 21. or 2.2 ...2.5

I use a slide different connection :

Dim conn As ADODB.Connection
Dim rec As ADODB.Recordset
Set conn = New ADODB.Connection
Set rec = New ADODB.Recordset
conn.Open "Provider= Microsoft.Jet.OLEDB.4.0;" & "Data Source = " & sfile";"
rec.Open "SELECT * FROM MYTABLE ;", conn, adOpenForwardOnly, adLockReadOnly
Do While rec.EOF = False
.....
loop
rec.Close
conn.close
set rec = nothing
set conn = nothing

Regards
JY

"alpder" wrote in
message ...

I inherited some programs written by a previous employee. We have
recently upgraded all our PCs from NT4 to XP SP2 and have upgraded
Office97 to Office2003. The code connects an Excel spreadsheet to an
Access database and extracts data from the mdb file
This program works perfectly on some PCs but not others.
Can anyone tell me where to start looking? I have checked MDAC and all
PCs are on 2.8

-Dim DB As ADODB.Connection
Set DB = New ADODB.Connection
Dim RS As ADODB.Recordset
Sheets("Calculation").Activate
sFile = "P:\cutcards.mdb"
DB.Open "Driver=Microsoft Access Driver (*.mdb);DBQ=" & sFile-

I would be very grateful for any assistance.


--
alpder
------------------------------------------------------------------------
alpder's Profile:

http://www.excelforum.com/member.php...o&userid=28547
View this thread: http://www.excelforum.com/showthread...hreadid=482074