Hi, hope you can help, i am quite new to this.

I need to know who to write data from several text boxes on a form to a sql database.

I have created the sql database on a localhost using myphp admin, i have created the connection in a module named as dbconnect()

i can try the connection and this connects fine, but unsure how to write the data from the texboxes to the database.

hope you can help.


Edited 7 Years Ago by CasperG: Typos

Essentially all you need to do is pass a SQL statement to the server. With SQL Server it would be something like. Not sure what you're using, but it should be similar.. just with some different connection/command objects.

Dim sqlCnn As SqlConnection
        Dim sqlCmd As SqlCommand

        sqlCnn = New SqlConnection(<connection_string>)
        sqlCmd = New SqlCommand(<sql_statement>, sqlCnn)
        sqlCmd.Connection = sqlCnn
        sqlCmd.CommandText = inSQL

        sqlCmd = Nothing

Edited 7 Years Ago by lancebird: n/a

Thanks all for replies, but managed to resolve this today, bit of surfing on the net and a ebook later.


This question has already been answered. Start a new discussion instead.