Working with SQL Server
How many of you out there have to write LotusScript code to access MS SQL Server? Lucky for me, I get to do it all the time. Since I'm in a Windows-based environment, I tend to use 'ado' objects to do my connecting. One of the advantages of using ado is that there are thousands of VB examples of connecting to SQL Server. So, I started by simply copying and pasting those examples into my LotusScript and viola....Error messages! But, most of those errors were because I hadn't defined all of those constants that VB uses. Things like 'adCmdText'. Well, rather than define those over and over, here's a quick little tip.
Find the file called 'adovbs.inc' It's usually located in the '\\Program Files\Common Files\System\ado' directory. Open it with Notepad, copy it, paste it into a new script library and save the library. (I save mine as adovbs.inc.) Now, simply "Use" that script library and you never have to worry about defining those VB constants ever again.
If you ever have any other questions about connecting to SQL Server, drop me a line, I'd be happy to help where I can. Then, you too, can be writing things like "SELECT * FROM Users WHERE clue >0" and get empty result sets.
Have fun!
|
Ratings
0
|
Comments (0)