|
|
Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
I have Excel 2003. I am trying to run a code to connect to an ODBC and run a stored procedure. I can not connect. Please help. The code looks something like:
Sub SetTrigger_LOCK_Reports() Dim db1 As QueryTable DBName = "MY_Reports" sqlstring = "MY_Reports.dbo.spSetReportLinkAvailability ([ at ]isActive = 0,[ at ]message = 'Current reports are being processed at this time.)"
myUID = "ItsMe" myPWD = "No_Really!" connstring = _ "ODBC;DSN=MY_Reports;" _ & "UID= " & myUID & ";" _ & "PWD= " & myPWD & ";" _ & "Database=MY_Reports" Application.Workbooks.OpenDatabase Filename:=connstring 'execute MY_Reports.dbo.spSetReportLinkAvailability ([ at ]isActive = 0,[ at ]message = 'Current reports are being processed at this time.') MsgBox (db1.Name) 'db1.Close Range("STATUS").Value = "Locked" End Sub
What am I doing wrong? Do need the Driver or the name of the DB Server? I a lost! TIA Candyman
|
|
|