Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Database Help Please.

Options
  • 07-08-2002 4:33pm
    #1
    Closed Accounts Posts: 50 ✭✭


    I have the ASP code i need to actually submit the info to the database but when it comes to actually creating the DB i get lost.

    The DB will use the MySQL driver and i want to create it in windows.

    How do i create that DB?

    Thankyou.


Comments

  • Closed Accounts Posts: 2,161 ✭✭✭steve-hosting36


    Simply create a blank database, and then your scripts can connect to it and populate it


  • Closed Accounts Posts: 50 ✭✭7Day Theory


    So i exported a current DB that works, renamed it to "example" and uploaded back onto the server.
    Scripted the code:
    <%



    ConnectionString="DRIVER=org.gjt.mm.mysql.Driver;URL={jdbc:mysql://mysql.domain.com/dbname};uid=username;pwd=password;"

    set con=server.createobject("adodb.connection")

    con.open(ConnectionString)

    set rs=server.createobject("adodb.recordset")

    dim rss

    set rss=server.createobject("adodb.recordset")

    dim k





    rss=con.execute("select max(supplierid) as id from example")

    k=rss("id")

    t1=k+1



    dim rs1,con

    set rs1=server.createobject("adodb.recordset")

    t2=Request.Form("t2")

    t3=Request.Form("t3")

    t4=Request.Form("t4")

    t5=Request.Form("t5")

    t6=Request.Form("t6")

    t7=Request.Form("t7")

    t8=Request.Form("t8")

    t9=Request.Form("t9")

    t10=Request.Form("t10")

    t11=Request.Form("t11")

    t12=Request.Form("t12")

    t13=Request.Form("t13")

    t14=Request.Form("t14")

    t15=Request.Form("t15")

    'response.write(t1&t2&t3&t4&t5&t6&t7&t8&t9&t10&t11&t12&t13&t14&t15)

    dim st

    st="insert into example values("&t1&",'"&t2&"','"&t3&"','"&t4&"','"&t5&"','"&t6&"','"&t7&"','"&t8&"','"&t9&"','"&t10&"','"&t11&"','"&t12&"','"&t13&"','"&t14&"','"&t15&"')"

    Response.Write(st)

    rs1=con.execute("insert into example values("&t1&",'"&t2&"','"&t3&"','"&t4&"','"&t5&"','"&t6&"','"&t7&"','"&t8&"','"&t9&"','"&t10&"','"&t11&"','"&t12&"','"&t13&"','"&t14&"','"&t15&"')")



    response.write("inserted it")

    %>

    and i get the following error:
    VBScript compilation error 1041 :


    Name redefined

    /test/inser.asp line 1


    Thankyou very much.
    :)

    Anyone have any ideas?


  • Registered Users Posts: 2,781 ✭✭✭amen


    probally this line

    dim rs1,con
    you have already used con above
    and now you are telling asp its a new variable

    remove the ,con and away u go

    I hope!!!

    e


Advertisement