Hi,

I thought the server variable comes from the odbc branch. I will try and declare it now.

best

Richard
----- Original Message ----- From: "Doug Lee" <[email protected]>
To: <[email protected]>
Sent: Tuesday, May 31, 2011 3:06 PM
Subject: [Spamverdacht] Re: Reading from MySqlTable?


Where does the variable "server" come from?  I see you dim "myserver"
but not "server."

On Tue, May 31, 2011 at 02:59:47PM +0200, Richard Emling wrote:
Dear Scripters,

I am about to write a WE App wich uses stuff from a MySql Database. As
far as i heard, I can make use of ADO to retrive this information.
Sadly i get an Error in Line 5, telling me that variable isn't
declared. Here my code:

option explicit
dim myserver, mydatabase, myconn, connection, sql
myserver = "localhost"
mydatabase = "test"
set myconn = server.createobject("adodb.connection")
connection = "driver={MySQL};server=myserver;uid=demo;database=mydatabase"
myconn.open (connection)
set result = server.createobject("adodb.recordset")
sql = "SELECT * FROM test"
set result = myconn.execute(sql)
if not result.EOF then
' print lines
end if

Who can give my some advice, or can provide with a working solution
for mysql connections from VB-Script?

Best wishes

Richard

--
Doug Lee, Senior Accessibility Programmer
SSB BART Group - Accessibility-on-Demand
mailto:[email protected]  http://www.ssbbartgroup.com
"While they were saying among themselves it cannot be done,
it was done." --Helen Keller


.


Reply via email to