Hi,
could someone give me an example, how to connect to an MS SQL Server and doing a "select" using the new db feature in MacroScheduler10.
Regards,
Matthias
Example for connection to MS SQL Server / MacroScheduler 10
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
You just need the appropriate connection string for your MS SQL Server in the DBConnect line. Otherwise everything else is the same. Read your SQL Server manual to see what the connection string is.
Or use Google:
http://www.google.com/search?q=MS+SQL+S ... ion+String
Or use Google:
http://www.google.com/search?q=MS+SQL+S ... ion+String
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?
Thanks for the hint.
The following script works
While the following script does not return any result
It works also with one fieldname after select
The failing select expression works in SQL ServerManagementStudio.
Am i doing something wrong?
Regards,
Matthias
The following script works
Code: Select all
DBConnect>Driver={SQL Server};Server=192.168.168.33;Database=sale;Uid=sa;Pwd=12345;,dbH
DBQuery>dbH,select * from AEL where aranummer =10,rset,NumRecs,NumFields
dbclose>dbH
Code: Select all
DBConnect>Driver={SQL Server};Server=192.168.168.33;Database=sale;Uid=sa;Pwd=12345;,dbH
DBQuery>dbH,select aranummer, artyp from AEL where aranummer =10,rset,NumRecs,NumFields
dbclose>dbH
Code: Select all
DBQuery>dbH,select aranummer from AEL where aranummer =10,rset,NumRecs,NumFields
Am i doing something wrong?
Regards,
Matthias
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Your SQL has commas in it. So do this:
I think it's more readable to put the SQL in a variable anyway.
I have just written a blog post about the new DB commands here:
http://www.mjtnet.com/blog/2008/04/15/u ... functions/
Code: Select all
DBConnect>Driver={SQL Server};Server=192.168.168.33;Database=sale;Uid=sa;Pwd=12345;,dbH
Let>SQL=select aranummer, artyp from AEL where aranummer =10
DBQuery>dbH,SQL,rset,NumRecs,NumFields
DBClose>dbH
I have just written a blog post about the new DB commands here:
http://www.mjtnet.com/blog/2008/04/15/u ... functions/
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?