Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

type mismatch in SQL statement

Status
Not open for further replies.

tyedyejenn

Programmer
Jun 14, 2000
35
US
I am writing a Visual basic program and i am getting a type mismatch error on my SQL statement.&nbsp;&nbsp;I am new to SQL so forgive my stupidity.&nbsp;&nbsp;Here is my SQL statement<br><br>strSQL = &quot;SELECT RepID, Password, UserAccessLevel &quot; & _<br><br>strSQL = strSQL + &quot;FROM RepIDTable &quot; & _<br><br>strSQL = strSQL + &quot;WHERE RepID='&quot; & strRepId & _<br><br>strSQL = strSQL + &quot;AND Password='&quot; & strPassword & &quot;';&quot;<br><br>If anyone can help I would appreciate it<br>thanks
 
try this one liner instead.<br>I hate that line continuation thingy anyway.<br>strSQL = &quot;SELECT RepID, Password, UserAccessLevel FROM RepIDTable WHERE RepID='&quot; & strRepId & &quot;AND Password='&quot; & strPassword & &quot;';&quot;<br><br>also if you use the line contiunation leave out the <br>strSQL = strSQL &<br>strSQL = &quot;SELECT RepID, Password, UserAccessLevel &quot; & _<br>&quot;FROM RepIDTable &quot; & _<br>etc.<br><br>It knows what to do if you do it right.<br>the continuation thing is just to make it easier for you to read the long line so you don't have to scroll.<br><br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top