Here is a very basic example of an SQL connection with a dsn-less connection to a Microsoft SQL Server. (pvxplus 21)
This is through windx and for reference on linux but should work elsewhere.
I had great difficulty with the documentation finding this so I hope it can be updated for this simple case, I hope this helps someone I found numerous mailing list tips ideas on this and I wanted to just summarize it all to a very simple real world example.
SQL_Server = CONSTRUCT-SQL
SQL_Database = Artcraft_Machines
uid = SQL user id
pwd = SQL password
SQL_Table = scm_artcraft
Now because I specify "uid" and "pwd" in the connect string with the OPT= We do not have to pass the different syntax of USER=abc, PSWD=def on the Open. If you do not specify in connect string then you must use this USER/PSWD syntax on open.
Also it's critical to pass "ignore;" as the first parameter on the open as it just skips this because we are using a connect string but you still need it on the open as a padding.
There was also notes of using {SQL Server Native CLient 11.0} instead of {SQL Server} or whatever vers I think this is needed, I assume based on windows versions. This may differ based on your SQL version. But for me I was just trying a regular Microsoft SQL Server.
This is through windx and for reference on linux but should work elsewhere.
I had great difficulty with the documentation finding this so I hope it can be updated for this simple case, I hope this helps someone I found numerous mailing list tips ideas on this and I wanted to just summarize it all to a very simple real world example.
SQL_Server = CONSTRUCT-SQL
SQL_Database = Artcraft_Machines
uid = SQL user id
pwd = SQL password
SQL_Table = scm_artcraft
Now because I specify "uid" and "pwd" in the connect string with the OPT= We do not have to pass the different syntax of USER=abc, PSWD=def on the Open. If you do not specify in connect string then you must use this USER/PSWD syntax on open.
Also it's critical to pass "ignore;" as the first parameter on the open as it just skips this because we are using a connect string but you still need it on the open as a padding.
Code Select
0010 begin
0020 !
0030 let OPT$="CONNECT='Driver={SQL Server};Server=CONSTRUCT-SQL;Database=Artcraft_Machines;uid=artmachine;pwd=artmachine'"
0040 open (1,iol=*,opt=OPT$)"[lcl][odb]ignore;scm_artcraft;Key=Code" ! ;USER=artmachine;PSWD=artmachine"
0050 !
0060 select * from 1
0070 print CODE$," ",THICKNESS,"x ",WIDTH," x ",LENGTH
0080 next record
0090 !
0100 print lst(iol(1))
There was also notes of using {SQL Server Native CLient 11.0} instead of {SQL Server} or whatever vers I think this is needed, I assume based on windows versions. This may differ based on your SQL version. But for me I was just trying a regular Microsoft SQL Server.