Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending information to a SQL Server

Status
Not open for further replies.

chmilz

Programmer
Jan 10, 2001
94
CA
Hello all,

I am a webmaster for an IT Consulting Comapany's website. The company wants employees to be able to enter their timesheet information on line by way of a form (easy enough) then they want that information sent to a table in an SQL Database on the company server. Can THIS be done using VBScript?? Thanks for your ideas and replies in advance!
 
Is this just a straight forward 'save to database' thing or am i missing something more complex?

If so are you after a basic explanation of adding and deleting records from a database? Nick (Web Developer)


nick@retrographics.co.uk
 
Nick,

Yes,


I just want to be able to insert the data into a table on the SQL Server. Nothing to complex...

Thanks,
Chmilz
 
A simple insert command that I use:

set ad = CreateObject("ADODB.Connection")
strConnect = "Provider=SQLOLEDB;Server=169.254.1.1;database=testdatabase;uid=dbaseuser"
ad.Open strConnect

form1 = Request.Form("field1")
form2 = Request.Form("field2")
form3 = Request.Form("field3")

strSQL= "INSERT INTO YOUR_TABLE(column1, column2, column3) VALUES('" & form1 & "','" & form2 & "','" & form3 & ')"
ad.execute(strSQL)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top