**** this error

Results 1 to 3 of 3

Thread: **** this error

  1. #1
    Pooh Guest

    Default **** this error

    I am trying to create a table on the fly in ASP. Here is my code so far:<BR><BR>if Request.Form("product") &#060;&#062; "" then<BR> <BR> strSQL = "CREATE TABLE userorder" & Session("objShopCart")<BR> strSQL = strSQL & "{"<BR> strSQL = strSQL & "sesID CHAR(10) NOT NULL PRIMARY KEY,"<BR> strSQL = strSQL & "prodID CHAR(10) NOT NULL,"<BR> strSQL = strSQL & "quantID CHAR(10) NOT NULL"<BR> strSQL = strSQL & "};"<BR><BR>set conn = server.CreateObject("adodb.Connection")<BR><BR>con n.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../amd.mdb")<BR><BR>set cmd = server.createobject("adodb.command")<BR>cmd.Execut e(strSQL)<BR><BR>once the table is made, I want to insert a record. But i cant get past this error:<BR><BR>The connection cannot be used to perform this operation. It is either closed or invalid in this context.<BR><BR>the line it bombs out is when I use the execute method for my cmd object.<BR><BR>Can anyone shed some light on this? Thanks in advance!

  2. #2
    Join Date
    Dec 1969

    Default RE: **** this error

    I&#039;m not sure since I only use the connection object, but are you sure that Execute is valid for the command object?<BR><BR>Why not just use the connection object?

  3. #3
    Pooh Guest

    Default RE: **** this error

    Great question, Ghost... lol I did it and got another error (Its in my CREATE table statement; I can work that out)<BR><BR>Thanks for helping this dodo head<BR>Pooh

Posting Permissions

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