I have created a UDL file, contents of which are:
[oledb]
; Everything after this line is an OLE DB initstring
Provider=SQLOLEDB.1;Password=123456;Persist Security Info=True;User ID=sa;Initial Catalog=SRDB;Data Source=GCRDEV-7PRO\SRHOMES
Two code snippets:
Code: Select all
Set SqlUDL = 'test.udl'
If SqlConnect(hSql)
Call SalMessageBox('OK','Connected', MB_Ok)
However, what I would like to do is put all of that in the code, so this snippet:
Code: Select all
Set SqlUDL = 'Provider=SQLOLEDB.1;Password=123456;Persist Security Info=True;User ID=sa;Initial Catalog=SRDB;Data Source=GCRDEV-7PRO\SRHOMES'
If SqlConnect(hSql)
Call SalMessageBox('OK','Connected', MB_Ok)
Else
Call SalMessageBox('Bummer','ERROR', MB_Ok)
I'm probably doing something stupid, any advise is appreciated.
Thanks,
Roy.