syntax error in FROM statement

Results 1 to 5 of 5

Thread: syntax error in FROM statement

  1. #1
    Join Date
    Dec 1969

    Default syntax error in FROM statement

    I am trying to join three tables in an access database and keep getting sytax error in FROM statement. I am trying to insert data into these tables. The tables have just been created and there is no data in them. Would this cause this error since there are no records to select? Punctuation? Better ways to join?Any help is appreciated.<BR>&#039;Connect to Database <BR> Set Connect = Server.CreateObject("ADODB.Connection")<BR> Connect.Open = "DSN=Property"<BR> Set SelProperties = Server.CreateObject("ADODB.Recordset")<BR> SQLQuery = "SELECT * FROM OwnerInfo Join PropertyInfo"<BR> SQLQuery = SQLQuery & "ON OwnerInfo.UserID = PropertyInfo.OwnerID"<BR> SQLQuery = SQLQuery & "Join PropertyDetails"<BR> SQLQuery = SQLQuery & "ON PropertyInfo.DetailsID = PropertyDetails.DetailsID"<BR> SelProperties.Open SQLQuery, Connect, 2, 3<BR>%&#062;<BR>

  2. #2
    <eop> Guest

    Default Try DB Forum for this question...


  3. #3
    Medieval Dude Guest

    Default RE: syntax error in FROM statement

    Make sure you have some spaces at the end of yer lines, so that yer words don&#039;t all run together within yer SQLQuery string. Response.write it to the screen to make sure it looks correct.<BR><BR>Second, and this is BIG... it&#039;s not going to work to use * when you have more than one table with the same field names in them. You will need to use the AS keyword to distinguish them from each other, and that means that you&#039;ll most likely need to list out each and every field name in all three tables, assuming that you need each and every field from all three tables. The only shortcut would be to say table1.* and then list out the fields for the other two tables.

  4. #4
    Forum Police Guest

    Default That would be cross posting


  5. #5
    <eop> Guest

    Default Can anyone else in here cry about something??!!


Posting Permissions

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