Jump to content

ADODB Access trouble


Recommended Posts

I'm having trouble with a particular chunk of code. I cut and pasted the sql statement from access so I know the sql statement works in access. The variable I am looking up is a text field in the db. I am using v3.1.1.123 (beta). I've searched, I've rewritten. Wtf am i doing wrong?

$oConn = ObjCreate("ADODB.Connection")
$oRS = ObjCreate("ADODB.Recordset")
$oConn.Open("Driver={Microsoft Access Driver (*.mdb)};Dbq=transactions.mdb")
$oRS.Open('SELECT longtrader.Online FROM Cards, longtrader WHERE (((Cards.HashSet)="2184514647") AND ((Cards.CardName)=[longtrader]![Card Name]) AND ((Cards.Set)=[longtrader]![Set]))', $oConn, 1, 3) 
if $oRS.RecordCount <> 0 Then
   ;we own some
   $ary_hldr[3] = $oRS.Fields("Online").Value ;add  the number owned
Else
   ;we own none
   $ary_hldr[3] = 0
EndIf   
$oRS.Close
$oConn.Close

I get this error:

Posted Image

Thank you, in advance for any help you are willing to give.

Link to comment
Share on other sites

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...