0

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.

thanks

Edited by CasperG: Typos

3
Contributors
3
Replies
5
Views
8 Years
Discussion Span
Last Post by CasperG
0

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>)
        sqlCnn.Open()
        sqlCmd = New SqlCommand(<sql_statement>, sqlCnn)
        sqlCmd.Connection = sqlCnn
        sqlCmd.CommandText = inSQL
        sqlCmd.ExecuteNonQuery()

        sqlCmd = Nothing
        sqlCnn.Close()

Edited by lancebird: n/a

0

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

thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.