Jump to content

Recommended Posts

Posted

I'm having trouble with an sql statement that I need to return all the info that = a certain PlayerID and OpponentID depending on what Plaer name I have selected from combo boxes

$oRS.Open ("Select * FROM Batting WHERE PlayerID='" $PlayerID '"' & '"AND OpponentID="' $OpponentID '"', $oConn, 1, 3)

Just doesn't seem to work.. Any help would be great,,,,

Posted (edited)

Have you EVER used strings before? Try creating a string that will work in a msgbox first before you start playing with that.

$PlayerID = 'Rob'
$OpponentID = 'Fred'
MsgBox(0, 0, "Select * FROM Batting WHERE PlayerID='" $PlayerID '"' & '"AND OpponentID="' $OpponentID '"')

Once you figure out how to make that run without getting errors, perhaps you can continue in a successful fashion.

*Edit: And yes, I know that code doesn't work. That's the point.

Edited by Saunders
Posted

Have you EVER used strings before? Try creating a string that will work in a msgbox first before you start playing with that.

$PlayerID = 'Rob'
$OpponentID = 'Fred'
MsgBox(0, 0, "Select * FROM Batting WHERE PlayerID='" $PlayerID '"' & '"AND OpponentID="' $OpponentID '"')

Once you figure out how to make that run without getting errors, perhaps you can continue in a successful fashion.

*Edit: And yes, I know that code doesn't work. That's the point.

I never even knew you could use a message box like that..

Thanks for the GREAT HELP!!!

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
  • Recently Browsing   0 members

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