SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Sep 2002
    Location
    Downunder
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Red face Syntax error in FROM clause ????

    Code:
    <%
    Set dbcn = Server.CreateObject("ADODB.Connection")
    dbcn.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("data\main.mdb")
    dbcn.open
    %>
    Above code is from an insert at the top of the page

    Code:
    <%
    	Dim rsQuery  ' As ADODB.Recordset
    	Set rsQuery = Server.Createobject("ADODB.Recordset")
    	rsQuery.Open "SELECT * FROM group", dbcn
    	'
    	Do while not rsQuery.EOF
    		Response.write rsQuery("Description")
    		rsQuery.MoveNext
    	Loop
    	rsQuery.Close
    	db.close
    %>
    Not seeing anything wrong here. "group" is the file name, the database connection isn't erroring out ???????

    TIA

  2. #2
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    group is a reserved word. Format your query like this:

    Code:
    "SELECT * FROM [group]"

  3. #3
    SitePoint Evangelist
    Join Date
    Sep 2002
    Location
    Downunder
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That'll teach me for not prefixing file names Thanks Thing, some more newbish questions on the way in due course.


Bookmarks

Posting Permissions

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