I am sure this question has been answered somewhere but I've been away from programming for a year and need a fresher. I am unable to create File or System DSN due to Virtual machines and restrictions placed on them. I need to (a) either use an in-line connection to MS SQL servers (i.e. Server=myServerAddress;Database=myDataBase;User Id=myUsername;
Password=myPassword;) or dynamically create a DSN file and connect or (c) something else. I think I've done this before but I was unable to take scripts when left old company. any suggestions on ways to solve my issue???
Thanks
Search the Tech Database for examples?
Jim
And here:
https://www.connectionstrings.com/ (https://www.connectionstrings.com/)
I did go there but I guess I must be not programming it right. is there an example of DSN less winbatch code? I must have missed it
I am using thsi code (xxxx are filled in)
hdbc = qAllocConnect(henv)
If hdbc == -1
retcode = qLastCode()
Message("qAllocConnect failed", retcode)
Exit
Endif
oConnect="Driver={SQL Server};Server=xxxx\Sqlexpress;Database=xxxx;User ID=xxxx;Password=;Trusted_Connection=True;"
ret=qDriverCon(hdbc, cConnect, 0); don't prompt user.
but get this error message (attached)
ok, never mind ... thanks all. I figured it out
In case you find it useful....search in the TechDatabase for:
ADO SQLOLEDB Example
Jim