Results 1 to 2 of 2

Thread: Database

  1. #1
    Rob Guest

    Default Database

    I have VB code to insert 3 text fields into database. I also went to automatically insert a date into the first field in the database. Do I need a seperate INSERT INTO command? How do I go about doing this?

  2. #2
    TheSync Guest

    Default RE: Database

    create a connection to the database.<BR>build a SQL string<BR>open the connection to database.<BR>execute SQL string<BR>Then close everything.<BR><BR>connstring = "how you connect to database. using SQL or Access.. or whatever."<BR><BR>set My_Conn = server.createobject("ADODB.Connection")<BR>strSql = "Insert Into Table (Field1, Field2, Field3) VALUES (&#039"<BR>strSql = strSql & request.querystring("TextBox1") &"&#039, &#039"<BR>strSql = strSql & request.querystring("TextBox2") &"&#039, &#039"<BR>strSql = strSql & request.querystring("TextBox3") &"&#039)"<BR>My_Conn.Open ConnString<BR>My_Conn.Execute (strSql)<BR>My_Conn.Close<BR>Set My_Conn = nothing<BR><BR>All you have to do is create your connection string..<BR><BR>note: if you are using a form method of post you will need to use request.form instead of request.querystring<BR><BR>hope this helps some..<BR><BR>TheSync<BR>

Posting Permissions

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