Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Database Help Please.

  • 07-08-2002 04: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, Registered Users 2 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