Problem in SQL-(AccessDB Table Name Spacing)!! HELP!!

Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Problem in SQL-(AccessDB Table Name Spacing)!! HELP!!

  1. #1
    Join Date
    Dec 1969
    Posts
    487

    Default Problem in SQL-(AccessDB Table Name Spacing)!! HELP!!

    I have a Access DB Table name : Employee List<BR>The problems arise when i am trying to run the following <BR>SQL command in ASP.<BR><BR>set sqltemp=conntemp.execute("select Employee List.Name,Employee List.Address from Employee List Order by Name")<BR><BR>I know that this problem can be solved by deleting the spacing in the table name at access db. Is there anyone out there to enlighten me to solve this problem without deleting the space??<BR>Your help is greatly appreciated.

  2. #2
    Stephen Fisher Guest

    Default RE: Problem in SQL-(AccessDB Table Name Spacing)!! HELP!!

    Try: select [Employee List].Name,[Employee List].Address from [Employee List] Order by Name<BR><BR>If any ofthe column names have spaces they need to be in square brackets as well.

  3. #3
    Join Date
    Dec 1969
    Posts
    487

    Default RE: Problem in SQL-(AccessDB Table Name Spacing)!! HELP!!

    Hi, Thanks for responding. I tried using your method before. However, still got errors accessing the database.

  4. #4
    Join Date
    Dec 1969
    Posts
    487

    Default RE: Problem in SQL-(AccessDB Table Name Spacing)!! HELP!!

    Stephen, Thanks for the tip. I managed to get it done with your sq bracket. I dont know why, I can only get it done after I upgrade my NT Server to Service Pack 5<BR>


  5. #5
    Greg Talbert Guest

    Default RE: Problem in SQL-(AccessDB Table Name Spacing)!!

    Create a Query in Access and give it a name without spaces. Then reference this query instead of the table in your asp code and sql statements.

  6. #6
    Greg Talbert Guest

    Default RE: Problem in SQL-(AccessDB Table Name Spacing)!!

    Create a Query in Access and give it a name without spaces. Then reference this query instead of the table in your asp code and sql statements.

  7. #7
    Join Date
    Dec 1969
    Posts
    1,388

    Default RE: Problem in SQL-(AccessDB Table Name Spacing)!!

    You can also reference your fields by objRS.fields(0).value<BR><BR>objRS = your recordsource<BR>(0) = the number of the selected field in your query (start with 0)

  8. #8
    Join Date
    Dec 1969
    Posts
    34

    Default RE: Problem in SQL-(Using a Query created in Acces

    How does one reference an Access Query in ASP ?<BR><BR>I have some very complex queries which I build in a variable (strSQL)using SQL. then I use<BR>set oRS = conn.execute(strSQL)<BR><BR>How would I build this using an Access query ?

  9. #9
    Join Date
    Dec 1969
    Posts
    96,118

    Default Well, you *can* treat...

    ...a stored query as a table.<BR> SELECT * FROM queryname<BR><BR>But try this:<BR>http://www.stardeveloper.com/articles/display.html?article=2001050101&page=2

  10. #10
    Join Date
    Dec 1969
    Posts
    34

    Default RE: Well, you *can* treat...

    Bill,<BR>Thanks very much.<BR><BR>This works great for select queries, can I ask how you would use delete, or update queries in a similar way, please ?

Posting Permissions

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