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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert into database

Status
Not open for further replies.

exodus300

Programmer
Mar 22, 2002
262
AU
I am familiar with using the following code in ASP (vbscript) to put stuff in a database. Now I want to do this in VB. Can somebody please help me change this stuff to work from a VB app?

Code:
Set db = Server.CreateObject("ADODB.Connection")
db.Open "MyDatabaseName"
sql = "INSERT INTO blablabla...."
db.Execute(sql)
db.Close
Set db = Nothing


Thank you. [Thanks in advance|Hope I helped you]
Exodus300
[pc3]
 
Search this site for ADO and/or connection and you will find lots of examples. The VB help files and MSDN also have good examples. Thanks and Good Luck!

zemp
 
exodus - Works the same way... I've copied/pasted code from an ASP page into a VBA or a VB project and it runs like a charm...
------------------------------------
[yinyang] 18 years of programming, and still learning every day! [yinyang]
 
OH, Except that you don't put the "Server." in there.. just CreateObject("adodb.connection")

------------------------------------
[yinyang] 18 years of programming, and still learning every day! [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top