Vince Maskeeper
Senior HTF Member
- Joined
- Jan 18, 1999
- Messages
- 6,500
Ok, I know enough with ASP/VBscript to be dangerous- but not enought to solve my own problems much of the time.
Back when I started, I wrote some DB interfacing scripts from a few "self help" books on the topic, and had no trouble. In my case, i was doing no DB updating or editing via web, so it was just read/display- which was easy. At soem point, the guy who owns my servers helped me streamline some code, and changed the method by which i was connecting to the database.
So, now I'm trying to write a quick script to update a databse I have (basically is going through the entries, testing a condition and assigning a property to a DB field based on the condition). Unfortunately, since my connection method is different than it was in the book, none of the conditions I try to include in the connection string will work.
I understand that some sort of lock method has to be passed with the connection commands to open the DB for writing/updating, but I can't figure out the syntax to use with my specific connection menthod...
In the book they use something like adOpenOptimistic, adOpenStatic-- but when i try to encorporate these into my string- I get errors that they are undefined variables (when i assumed they were part of the lang). It seems that the connection method I'm using is looking for a different type of argument.
I notice in one script I found online, with a similar syntax of DB connection, they followed theirs with ,2,2- which seemed to be the argument for opening it and being able to update/edit. When I tried to encorporate the ,2,2 intro my connection, I got errors again (although i'm unsure what they were, can try again and post if needed).
Since I am more of a "oh my god, it works" kind of scripting person at this point, not so much a "how do I streamline this to get .22 nonoseconds of performance out of it"-- I'm a bit out of my leugue with tinkering with how the script calls the DB- so any tips would be helpful. I will post below an example of my exact script.
Back when I started, I wrote some DB interfacing scripts from a few "self help" books on the topic, and had no trouble. In my case, i was doing no DB updating or editing via web, so it was just read/display- which was easy. At soem point, the guy who owns my servers helped me streamline some code, and changed the method by which i was connecting to the database.
So, now I'm trying to write a quick script to update a databse I have (basically is going through the entries, testing a condition and assigning a property to a DB field based on the condition). Unfortunately, since my connection method is different than it was in the book, none of the conditions I try to include in the connection string will work.
I understand that some sort of lock method has to be passed with the connection commands to open the DB for writing/updating, but I can't figure out the syntax to use with my specific connection menthod...
In the book they use something like adOpenOptimistic, adOpenStatic-- but when i try to encorporate these into my string- I get errors that they are undefined variables (when i assumed they were part of the lang). It seems that the connection method I'm using is looking for a different type of argument.
I notice in one script I found online, with a similar syntax of DB connection, they followed theirs with ,2,2- which seemed to be the argument for opening it and being able to update/edit. When I tried to encorporate the ,2,2 intro my connection, I got errors again (although i'm unsure what they were, can try again and post if needed).
Since I am more of a "oh my god, it works" kind of scripting person at this point, not so much a "how do I streamline this to get .22 nonoseconds of performance out of it"-- I'm a bit out of my leugue with tinkering with how the script calls the DB- so any tips would be helpful. I will post below an example of my exact script.