LoudASP Knowledge Base - ASP and Database
Active Server Page knowledge dealing with databases
Easy SQL How To (Insert)
If you need to put data into a table using SQL this is the code you will want to use.
SQLInsert = "Insert into MyTable (COL1, COL2) values('" & VAR1 & "','" & VAR2 & "')"
Change MyTable with the name of the table you want to insert data into. Then change COL1 and COL2 with the
name of the columns that are going to hold the data, finally VAR1 and VAR2 are the variables that have the
data that should be put into the database.
If you have more then one columns just continue the pattern. You would add COLx and then VARx. REMEMBER that
COL1 will equal VAR1 so what ever pattern you use for the columns you need to keep those positions for the
variables.
This FAQ has been read 5268 times.
How to Connect to a Database (DSNLESS)
Easy SQL How To (Insert)
Easy SQL Help (Update)
Easy SQL Help (Delete)
Easy SQL Apostrophes Bug Fix
Easy How To SQL (Select)
Database test for no records
|