Hi
I'm testing a connection to an Access database and looking up a filename
in a column but I keep getting an error with the following code :
Line3 Char5 - Object doesn't support this property or method
:'oCmd.Connection'
Function DoExecSQL(SQL,Params,Opt)
Set oCmd = CreateObject("ADODB.Command")
Set oCmd.Connection = oConn
oCmd.CommandText = SQL
Set DoExecSQL = oCmd.Execute(, Params, Opt)
End Function
Function ExecSQL(SQL, Params)
Set ExecSQL = DoExecSQL(SQL, Params, 0)
End Function
Function ExecSQLNoResults(SQL, Params)
Set ExecSQL = DoExecSQL(SQL, Params, 128)
End Function
Function GetDocumentFlag(Doc)
Set oRs = ExecSQL("SELECT * FROM FLAG WHERE FILENAME=?", Array(Doc))
If NOT oRs.EOF Then
GetDocumentFlag = oRs("FLAG").Value
Else
GetDocumentFlag = 0
End If
End Function
Set oConn = CreateObject("ADODB.Connection")
oConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\test.mdb;Persist Security Info=False"
oConn.Open
If GetDocumentFlag("thefilename") = True Then
MsgBox "found filename"
Else
MsgBox "not found filename"
End If
I'm not sure why the error - any thoughts ?
Thanks
JT


