Jump to content
Sign in to follow this  
sillyarms

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.

Share this post


Link to post
Share on other sites

Maybe you can start to add the COM error handler.

This will give you more details about the errors using COM objects.

See my signature (for example the MS LogParser) have the COM error handler of SvenP.

Success


Share this post


Link to post
Share on other sites

I think maybye that i should be using ADODB.record instead of ADODB.Recordset. I'm having troubles getting this attempt to work. Can anyone show me how use ADODB.Record?

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...