-
Creating Connection
Hello,
I have set up a MySQL database, guitarhangarcom, with a table, pollandsurvey, and am using the following ASP code to make the connection. For some reason the connection is not being made. Does anyone have any suggestions? Any help would be greatly appreciated.
<%
dim odbcConn
dim odbcRS
dim counter
dim error
set odbcConn = Server.CreateObject("ODBC.Connection")
set odbcRS = Server.CreateObject("ODBC.Recordset")
odbcConn.Open "Driver={mySQL};" & _
"Server=64.224.17.178;" & _
"Port=3306;" & _
"Option=16834;" & _
"Database=guitarhangarcom;" &_
"Uid=usr2136;" & _
"Pwd=AS567;"
odbcRS.ActiveConnection = odbcConn
if odbcConn.errors.count = 0 then
response.write "<h2>Fields In The 'pollandsurvey' Table:</h2>"
odbcRS.Open "describe pollandsurvey"
while not odbcRS.EOF
response.write odbcRS.fields(0).value & "<br>"
odbcRS.MoveNext
wend
else
response.write "ERROR: Couldn't connect to database"
end if
%>
Rob Batesole
Web Master
Collect Guitars / The Guitar Hangar
Phone 203-740-8889
Fax 203-740-2730
Check out our Websites!
www.guitarhangar.com
www.collectguitars.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|