About SQL queries...

Results 1 to 2 of 2

Thread: About SQL queries...

  1. #1
    Join Date
    Dec 1969

    Default About SQL queries...

    I have a question:<BR><BR>I create my connection and recordset objects, and also I store a SQL query inside a variable for my recordset.<BR><BR>Even though I type the query correctly, some errors tend to appear on screen, like: FROM keyword not found where expected, invalid column name, etc.<BR><BR>Example:<BR><BR>Report = " select user_id, user_pass "_<BR> &" from lge.tm_login "_<BR> &" where user_id = &#039;"&usuario&"&#039; "<BR><BR>Rs.Open Report, Conex<BR><BR>Sometimes it works, and other times don&#039;t. And although I typed all the data in the right way, the errors appear.<BR><BR>I&#039;m using an Oracle database, and the Microsoft ODBC 2.5 driver<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: About SQL queries...

    I do not see anything wrong, although you might try making your SQL a little cleaner:<BR><BR>Report = "SELECT user_id, user_pass FROM lge.tm WHERE user_id = &#039;" & usuario & "&#039; "<BR><BR>What does the usuario variable claim? It might not be finding a value for some entries, and then reporting null delcaring a keyword not found. YOu need to script alternative situations for that.<BR><BR>Have you read this? <BR>http://www.4guysfromrolla.com/webtech/090600-1.shtml<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts