View Full Version : Mismatch


mission2java_78
12-03-2002, 10:29 AM
I have the following:
Function FileSynced(fname As String) As Long
On Error GoTo Handle_It

Dim db As Database
Dim rs As Recordset
Dim arrFileArray() As String
Dim strFileString As String 'file name without path

arrFileArray = Split(fname, "\", , vbTextCompare)
strFileString = arrFileArray(UBound(arrFileArray))
Dim strTable As String
strTable = "tblFiles"

Set db = CurrentDb
Set rs = db.OpenRecordset(strTable)


Right when I hit set rs = db.openrecordset(strTable)

I get an error message as a type mismatch...not sure why I always open recordsets like this...

Jon

llkhoutx
12-03-2002, 10:31 AM
Try:

Set rs = db.OpenRecordset(strTable,dbOpenDynaset))

mission2java_78
12-03-2002, 10:32 AM
Tried that with the same error message...I jsut want to be able to open this table...
Jon

mission2java_78
12-03-2002, 10:36 AM
Got it working...needed to reference DAO in my declarations portion.

Dim db As DAO.Database
Dim rs As DAO.Recordset

thanks,
Jon