revOpenDatabase and revCloseDatabase
Posted: Mon Jul 28, 2008 8:04 am
Hello
I am new to RR. Currently, I am just testing, creating sample scripts to get used to working in the RR environment. I require a little hint, with regards to revOpenDatabase and revCloseDatabase. Here's the story.
I connect to a MySQL database (a remote one) with this is;
on mouseUp
put revOpenDatabase("MySQL","myTestServer.com","myDatabaseName","myDatabaseUser","myDatabasePassword") into dataConnectionID
if dataConnectionID is a number then
put dataConnectionID into field "fdbID"
else
answer dataConnectionID
end if
end mouseUp
So far (I think?!) so good, the script connects and puts the dataConnectionID in to a field called fdbID.
Now, I try to close the connection with this script;
on mouseUp
revCloseDatabase dataConnectionID
answer "Connection Terminated!"
end mouseUp
When I use this script to disconnect I get this error;
Type revdberr,invalid connection id
Object MySQL Close
Line revCloseDatabase dataConnectionID
Hint revCloseDatabase
Can anyone explain what it is I am doing wrong with this as according to the documentation I need to use the revCloseDatabase command including the connection variable - dataConnectionID - which I have done.
Any hints gratefully accepted!
I am new to RR. Currently, I am just testing, creating sample scripts to get used to working in the RR environment. I require a little hint, with regards to revOpenDatabase and revCloseDatabase. Here's the story.
I connect to a MySQL database (a remote one) with this is;
on mouseUp
put revOpenDatabase("MySQL","myTestServer.com","myDatabaseName","myDatabaseUser","myDatabasePassword") into dataConnectionID
if dataConnectionID is a number then
put dataConnectionID into field "fdbID"
else
answer dataConnectionID
end if
end mouseUp
So far (I think?!) so good, the script connects and puts the dataConnectionID in to a field called fdbID.
Now, I try to close the connection with this script;
on mouseUp
revCloseDatabase dataConnectionID
answer "Connection Terminated!"
end mouseUp
When I use this script to disconnect I get this error;
Type revdberr,invalid connection id
Object MySQL Close
Line revCloseDatabase dataConnectionID
Hint revCloseDatabase
Can anyone explain what it is I am doing wrong with this as according to the documentation I need to use the revCloseDatabase command including the connection variable - dataConnectionID - which I have done.
Any hints gratefully accepted!