09-24-2010, 12:36 PM
Hi Kandula,
Since elements (links, data etc) on web page sometime are floating, so we need to select from database.
Here I have made a paragraph of statement for DB connection and data selecting, and I have successfully connected with WEBDEV database. FYI.
****************************************************************************************
Since elements (links, data etc) on web page sometime are floating, so we need to select from database.
Here I have made a paragraph of statement for DB connection and data selecting, and I have successfully connected with WEBDEV database. FYI.
****************************************************************************************
Code:
Set Conn = CreateObject("ADODB.Connection" )
str="DRIVER={MySQL ODBC 3.51 Driver};SERVER=webdev;DATABASE=intranet;user id=root ; password=xxxxx"
Conn.open str
Set Rs = CreateObject ("ADODB.Recordset" )
sql = "select * from `user`;"
Rs.open sql,conn,1,3
If (not Rs.eof) then
Rs.MoveFirst
' show the first piece of record from user table'
MsgBox Rs(0)
MsgBox Rs(1)
MsgBox Rs(2)
MsgBox Rs(3)
MsgBox Rs(4)
MsgBox Rs(5)
MsgBox Rs(6)
end if
Rs.close
Set Rs = Nothing
Conn.close
Set Conn = Nothing