Trying to make a db connection (SQL Server 2000) and then populate a table (by executing a stored procedure) with data. I keep receiving an assortment of errors. Any suggestions to fix my code would be appreciated.
// Create db connection, insert values into generic table, and close db connection
VBSTART
Dim connstr
Dim MyDB
Dim rs
connstr= "Driver={OBDC MS SQL Server}; Data Source=***-***-***-*;Initial Catalog=db**;Persist Security Info=True;User ID=***;Password=****;"
Set MyDB = CreateObject("ADODB.Connection")
MyDB.Open connstr
rs = MyDB.Execute("uspScreenScrape_Test;")
VBEND
Thank you.
-brentmtc
db connection
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
"assortment of errors"? Please try being a little more specific.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
db Connection
I am now getting a connection to the db and able to insert some hard coded values(as in the commented out Let>) but I am not able to get values from the 'screen scrape' to be inserted using a stored procedure. Here is the code I have now.
Let>str=Driver={SQL SERVER};Server=***;Port=****;Database=***;User=***;Password=****;
DBConnect>str,dbH
//Let>SQL=Insert into tbGeneric_Patient_Info(LastName, FirstName) Select 'Harris', 'Sean'
Let>SQL=("uspScreenScrape_Test";)
DBExec>dbH,SQL,result
DBClose>dbH
Some of my 'screen scrape' values are %MRN%, %Suffix%,
%LastName%, etc.
Have any suggestions?
Thank you
-brentmtc
Let>str=Driver={SQL SERVER};Server=***;Port=****;Database=***;User=***;Password=****;
DBConnect>str,dbH
//Let>SQL=Insert into tbGeneric_Patient_Info(LastName, FirstName) Select 'Harris', 'Sean'
Let>SQL=("uspScreenScrape_Test";)
DBExec>dbH,SQL,result
DBClose>dbH
Some of my 'screen scrape' values are %MRN%, %Suffix%,
%LastName%, etc.
Have any suggestions?
Thank you
-brentmtc
db connection
I have not got my macro to execute my stored procedures yet. Any suggestions?
Thanks,
-brentmtc
Thanks,
-brentmtc