![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Connection to Access fails 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 |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Connection to Access fails JT schrieb: Quote: > 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 Set oCmd.ActiveConnection = oConn |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Connection to Access fails thanks! ekkehard.horner wrote: Quote: > JT schrieb: Quote: >> 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 > Set oCmd.ActiveConnection = oConn |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Email access OK but Web access fails | Network & Sharing | |||
| Fails to detect internet connection | Network & Sharing | |||
| Network Connection Fails from One Laptop but not the other | Vista networking & sharing | |||
| VPN connection was working, now fails with error 651 | Vista networking & sharing | |||
| Internet Connection fails afer about 60 mins | Vista General | |||