[OBD] CONNECT=

Started by bbssupport, July 11, 2024, 01:52:49 AM

Previous topic - Next topic

bbssupport

Having a problem using the OPT="CONNECT=" option when using OPEN [ODB] and trying to connect back to the PxPlus OBDC driver. It works fine with a DSN and the same connection string works with pxpsql.exe.

What am I doing wrong?

eg:
0010 LET CONNSTRING$="DRIVER={PxPlus® SQL ODBC Driver (64-bit)}; UID=A; PWD=B; DEBUG=1;Directory=D:\BBSCloud\BBSDev\DATA\DATA.BBS; Prefix=D:\BBSCloud\BBSDev\DATA\DATA.00,D:\BBSCloud\BBSDev\DATA\DATA.BBS,D:\BBSCloud\BBSDev\PROGS\PROGS.BBS; Company=00; LogFile=D:\BBSCloud\BBSDev\PXPSQLODBC.LOG; CacheSize=1024; DirtyReads=1; EnforceNULLDate=1; ReadOnly=1; SERVER=NotTheServer"
0020 OPEN (CHAN,OPT="CONNECT="+"'"+CONNSTRING$+"'")"[ODB]"

Returns:
IM002: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

I"ve tried all sorts of combinations around the CONNSTRING$ and cannot make it work.

However, the following command using the same connection string works perfectly.

"C:\PVX Plus Technologies\SQL ODBC Driver (64-bit)\pxpsql.exe" --connection-string "DRIVER={PxPlus® SQL ODBC Driver (64-bit)}; UID=A; PWD=B; DEBUG=1;Directory=D:\BBSCloud\BBSDev\DATA\DATA.BBS; Prefix=D:\BBSCloud\BBSDev\DATA\DATA.00,D:\BBSCloud\BBSDev\DATA\DATA.BBS,D:\BBSCloud\BBSDev\PROGS\PROGS.BBS; Company=00; LogFile=D:\BBSCloud\BBSDev\PXPSQLODBC.LOG; CacheSize=1024; DirtyReads=1; EnforceNULLDate=1; ReadOnly=1; SERVER=NotTheServer" "SELECT * FROM ARF12"

EVa

Are you using a 64-bit PxPlus (as you're using the 64-bit ODBC driver) ?

bbssupport

Yes I am - as stated, the same connection string works fine with the pxpsql.exe command

EVa

Allright - change line 20 to:

0020 OPEN (CHAN,OPT="CONNECT="+"'"+CONNSTRING$+"'")"[ODB];;"

(add ;; after [ODB]).

bbssupport