|
-
Feb 20th, 2002, 06:08 AM
#1
Thread Starter
Bouncy Member
problem opening excel file thru ADO
Hello all,
i've got this piece of code to open an excel spreadsheet using ADO, which has been working ok uptill now...
VB Code:
cnExcel.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strFilePath & ";" & "Extended Properties=""Excel 8.0;HDR=NO;IMEX=1"""
cnExcel.CursorLocation = adUseClient
cnExcel.Open
rstImport.Open "SELECT * FROM [Sheet1$]", cnExcel, adOpenStatic, adLockReadOnly
i've error trapped it and get an "unspecified error" on the last line.
I'm using MDAC 2.7 (ADO 2.6) and i can't work out what the problem is coz i haven't changed the excel file...
any ideas?
darrel.
-
Feb 20th, 2002, 06:19 AM
#2
Fanatic Member
(obvious question)
Have you checked your project references since you installed MDAC 2.7 - to see if anything has the "MISSING" prefix.....
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Feb 20th, 2002, 06:20 AM
#3
Thread Starter
Bouncy Member
yup, thats all ok, project compiles without any problems too.
-
Feb 20th, 2002, 06:24 AM
#4
Fanatic Member
I just ran your code with a reference to the following:
ADO 2.7
ADO 2.6
ADO 2.5
with no probs........
are you getting any error number at all....
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Feb 20th, 2002, 06:28 AM
#5
Thread Starter
Bouncy Member
-2147467259
-
Feb 20th, 2002, 06:33 AM
#6
Fanatic Member
Try reinstalling MDAC and going again......
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Feb 20th, 2002, 06:43 AM
#7
Thread Starter
Bouncy Member
-
Feb 20th, 2002, 06:53 AM
#8
Thread Starter
Bouncy Member
-
Feb 20th, 2002, 07:09 AM
#9
Thread Starter
Bouncy Member
oh come on people, don't tell me i've got everyone stumped!

anything else i can do to help you help me???
more code etc???
-
Feb 20th, 2002, 07:11 AM
#10
Fanatic Member
change your reference to ADO 2.7.....
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|