Do I need different references?

PerkinsSlave

New Member
Joined
Feb 1, 2004
Messages
26
Good evening,

I'm creating a program that imports data as part of its functionality. I'm having a problem getting one of my functions to run.

Here's an excerpt of the code:


Dim sreturn As String
Dim db As Database
Dim rs As Recordset
Dim Ssql As String
Dim iFile As Integer
Dim sFileName As String
Dim iPos As Integer
Dim sInput As String
Dim iLstPos As Integer
Dim iRow As Integer
Dim duprec As String

On Error GoTo ErrImportFile

sreturn = "File: " & conImportPath & "AgtGrpProd" & iInt & ".txt imported successfully."

Set db = CurrentDb
Ssql = "SELECT * From tblAgtGrpProd Where 1 = 2"
Set rs = db.OpenRecordset(Ssql, dbOpenDynaset)

When Access reaches the last line of code, it moves down to ErrImportFile. I have Microsoft DAO 3.51 included in my list of references... is there another one I need? Or is my syntax wrong?

Thanks!
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Thanks Corticus. Just tried that, still defaulting to the error procedure. I replaced my custom error reporting with a msgbox errdescription, and I'm receiving one of those fun Type Mismatch errors. I checked the spelling of the table name that I reference and that's okay. Any other thoughts?
 
Upvote 0

Forum statistics

Threads
1,221,618
Messages
6,160,873
Members
451,674
Latest member
TJPsmt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top