dear jay fields,
pls try this, hope this can help u...
dim objconn, objrs
set objconn = server.createobject("adodb.connection")
set objrs = server.createobject("adodb.recordset")
objconn.connectionstring="server=192.168.0.1;driver=MySQL;db=[database_name]
;uid=[user_name];pwd=[user_password]"
objconn.open connectionstring
dim find_text, delete_text, mxopr_cd, deletelog_text
mxopr_cd = session("oprcd")
find_text = "select * from tcity where tcity_code = '" &cd &"' order by
tcity_code asc"
delete_text = "delete from tcity where tcity_code = upper('" &cd &"');"
objrs.open find_text, objconn
if objrs.eof then
objrs.close
objconn.close
set objrs = nothing
set objconn = nothing
response.redirect "/source/err/err_recnotexist.html"
else
objrs.close
objconn.execute delete_text
objconn.close
set objrs = nothing
set objconn = nothing
response.redirect "/source/city/result_city_dele_ok.html"
end if
cheers,
Ivan Paul
Web Developer
Mediate - Media Communications
http://www.bhaktimedia.com
----- Original Message -----
From: Jay Fields <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 27, 2002 21:35
Subject: connecting to mysql via ODBC from asp.net
> I've installed the windows version of mysql. I configured nothing.
> This is the code I'm trying to use to access mysql from an asp web service
> (in vb):
> ---------
> <WebMethod()> Public Function dbConnect() As String
> Dim connString As String = "DRIVER={MySQL ODBC 3.51 Driver};" & _
> "SERVER=localhost;" & _
> "DATABASE=test;" & _
> "UID=test;" & _
> "PASSWORD=test;" & _
> "OPTION=3"
> Dim MyConnection As New OdbcConnection(connString)
> Try
> MyConnection.Open()
> MyConnection.Close()
> Return connString
> Catch e As Exception
> Return e.Message
> End Try
> End Function
> ----------------------
> It's returning the following exception: ERROR [IM002] [Microsoft][ODBC
> Driver Manager] Data source name not found and no default driver specified
>
> Any ideas?
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php