I need to test to see if a database is running through a PowerBuilder application. Every time that I test the connection the ODBC dialog box appears and the application just sits and waits for the return. What I want to do is if it fails the connection just return an error code in SQLCA.

This is my DBParm setting SQLCA.DBParm = "ConnectString='DSN=DATASOURCE_TEST;UID=dba;PWD=sql;ConnectOption='SQL_DRIVER_CONNECT,SQL_DRIVER_NOPROMPT'"

PowerBuilder 2017 and SQL Anywhere 16.

Any Ideas?

asked 06 Jul, 17:11

knbarton's gravatar image

knbarton
262
accept rate: 0%


Your DBParm is incorrect. The correct format is as follows:

"ConnectString='DSN=EAS Demo DB V126;UID=dba;PWD=<******>',ConnectOption='SQL_DRIVER_CONNECT,SQL_DRIVER_NOPROMPT'"

The problems with the DBPARM is provided is that the ConnectString must be closed with a quote and the ConnectString and ConnectOption must be separated with a comma not a semicolon.

permanent link

answered 06 Jul, 21:35

Chris%20Keating's gravatar image

Chris Keating
3.8k2165
accept rate: 31%

Thank you, that fixed the problem.

(09 Jul, 11:11) knbarton
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×130

question asked: 06 Jul, 17:11

question was seen: 38 times

last updated: 09 Jul, 11:11