PxPlus User Forum

Main Board => Discussions => ODBC => Topic started by: bbssupport on July 11, 2024, 01:52:49 AM

Title: [OBD] CONNECT=
Post by: bbssupport on July 11, 2024, 01:52:49 AM
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"
Title: Re: [OBD] CONNECT=
Post by: EVa on July 11, 2024, 03:26:16 AM
Are you using a 64-bit PxPlus (as you're using the 64-bit ODBC driver) ?
Title: Re: [OBD] CONNECT=
Post by: bbssupport on July 11, 2024, 06:49:14 PM
Yes I am - as stated, the same connection string works fine with the pxpsql.exe command
Title: Re: [OBD] CONNECT=
Post by: EVa on July 12, 2024, 03:07:33 AM
Allright - change line 20 to:

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

(add ;; after [ODB]).
Title: Re: [OBD] CONNECT=
Post by: bbssupport on July 12, 2024, 08:53:10 PM
PERFECT! Thank you :)