|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Connecting to database problem
Hey, I'm fairly new to web programming...I'm using MySQL, ASP, And VBScript...NOT PHP!! I have set up a connection between the database and dreamweaver...the database has 1 table with 1 field that is just a string named "message." All I want to do is connect to this database with VBScript and have it output the text in the message field...can someone PLEASE help me! thanks
Last edited by jimthing2001 : October 21st, 2003 at 02:33 AM. |
|
#2
|
|||
|
|||
|
In the simplest form, if you have a DSN set up to the database:
Code:
dim objConn, objRS
Set objConn = server.createobject("ADODB.Connection")
objConn.Open "DSN=MyDSNName"
Set objRS = ObjConn.Execute("SELECT Message FROM Table")
|
|
#3
|
|||
|
|||
|
Quote:
Code:
do while not objRS.eof
response.write objRS("fieldname") & "<br>"
loop
objConn.close
|
|
#4
|
|||
|
|||
|
Yeah, I kinda forgot the output part
![]() |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Connecting to databse problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|