Sign in to follow this  
Followers 0
Ghost21

SQL Statement Help

3 posts in this topic

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,,,,

Share this post


Link to post
Share on other sites



#2 ·  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

Share this post


Link to post
Share on other sites

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!!!

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  
Followers 0