Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Liant Relativityv6 and Crystal 8.5

Status
Not open for further replies.

Memento

MIS
Jun 19, 2005
46
US
I'm using a Liant Relativityv6 ODBC Driver with Crystal Reports 8.5, and keep getting a Logon Box pop up. I can click "ok", and it loads the information. It's annoying. I can't seem to figure out a solution to get rid of it. I know it has something to do with opening the connection because I don't get the logon box if I already have the connection open through another report.

When I use Crystal 10 or XI, I never get the logon box. Our company uses Crystal 8.5, but I happen to have later versions on my development system.
 
You are correct in your speculation about the connection. On your later versions of Crystal, have you stored your connection information? (I am not a Crystal expert.)

One thing you can do to help diagnose this is to turn on ODBC tracing for the ODBC data source (using the windows ODBC applet). Then connect using the two versions of Crystal. You will probably see a difference in the connection mechanism.

In general, if the connection request does not supply a user id and password in the connection information, Relativity will prompt for that information (or fail the connection). So perhaps it is just as simple as determining how to preset that information in the version of Crystal.

Tom Morrison
 
Here's the ODBC Trace Log for Crystal 8.5. You'll notice it's only a few lines. It stops because the pop-up logon box appears, and the odbc connection waiting for me to hit ok.

CR8.5 ODBC Trace

crw32 78-3a4 ENTER SQLAllocHandle
SQLSMALLINT 1 <SQL_HANDLE_ENV>
SQLHANDLE 00000000
SQLHANDLE * 0121957C

crw32 78-3a4 EXIT SQLAllocHandle with return code 0 (SQL_SUCCESS)
SQLSMALLINT 1 <SQL_HANDLE_ENV>
SQLHANDLE 00000000
SQLHANDLE * 0x0121957C ( 0x024d1540)

crw32 78-3a4 ENTER SQLSetEnvAttr
SQLHENV 024D1540
SQLINTEGER 200 <SQL_ATTR_ODBC_VERSION>
SQLPOINTER 0x00000002
SQLINTEGER -6

crw32 78-3a4 EXIT SQLSetEnvAttr with return code 0 (SQL_SUCCESS)
SQLHENV 024D1540
SQLINTEGER 200 <SQL_ATTR_ODBC_VERSION>
SQLPOINTER 0x00000002 (BADMEM)
SQLINTEGER -6

crw32 78-3a4 ENTER SQLAllocHandle
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 024D1540
SQLHANDLE * 01219580

crw32 78-3a4 EXIT SQLAllocHandle with return code 0 (SQL_SUCCESS)
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 024D1540
SQLHANDLE * 0x01219580 ( 0x024d15e8)

crw32 78-3a4 ENTER SQLDriverConnectW
HDBC 024D15E8
HWND 006B0518
WCHAR * 0x74329A38 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x74329A38
SWORD 2
SWORD * 0x00000000
UWORD 1 <SQL_DRIVER_COMPLETE>
============Here's where it waits for me to click Ok.======

Here's the Crystal 11 ODBC trace at the same point. Only...it returns the data without the prompt.


crw32 9d0-eb0 ENTER SQLAllocHandle
SQLSMALLINT 1 <SQL_HANDLE_ENV>
SQLHANDLE 00000000
SQLHANDLE * 7FDBCF7C

crw32 9d0-eb0 EXIT SQLAllocHandle with return code 0 (SQL_SUCCESS)
SQLSMALLINT 1 <SQL_HANDLE_ENV>
SQLHANDLE 00000000
SQLHANDLE * 0x7FDBCF7C ( 0x05af1540)

crw32 9d0-eb0 ENTER SQLSetEnvAttr
SQLHENV 05AF1540
SQLINTEGER 200 <SQL_ATTR_ODBC_VERSION>
SQLPOINTER 0x00000003
SQLINTEGER -6

crw32 9d0-eb0 EXIT SQLSetEnvAttr with return code 0 (SQL_SUCCESS)
SQLHENV 05AF1540
SQLINTEGER 200 <SQL_ATTR_ODBC_VERSION>
SQLPOINTER 0x00000003 (BADMEM)
SQLINTEGER -6

crw32 9d0-eb0 ENTER SQLAllocHandle
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 05AF1540
SQLHANDLE * 7FDBCF74

crw32 9d0-eb0 EXIT SQLAllocHandle with return code 0 (SQL_SUCCESS)
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 05AF1540
SQLHANDLE * 0x7FDBCF74 ( 0x05af15e8)

crw32 9d0-eb0 ENTER SQLSetConnectAttrW
SQLHDBC 05AF15E8
SQLINTEGER 101 <SQL_ATTR_ACCESS_MODE>
SQLPOINTER 0x00000001
SQLINTEGER 0

crw32 9d0-eb0 EXIT SQLSetConnectAttrW with return code 0 (SQL_SUCCESS)
SQLHDBC 05AF15E8
SQLINTEGER 101 <SQL_ATTR_ACCESS_MODE>
SQLPOINTER 0x00000001 (BADMEM)
SQLINTEGER 0

crw32 9d0-eb0 ENTER SQLSetConnectAttrW
SQLHDBC 05AF15E8
SQLINTEGER 111 <SQL_ATTR_QUIET_MODE>
SQLPOINTER 00000000
SQLINTEGER -3

crw32 9d0-eb0 EXIT SQLSetConnectAttrW with return code 0 (SQL_SUCCESS)
SQLHDBC 05AF15E8
SQLINTEGER 111 <SQL_ATTR_QUIET_MODE>
SQLPOINTER 00000000
SQLINTEGER -3

crw32 9d0-eb0 ENTER SQLConnectW
HDBC 05AF15E8
WCHAR * 0x7FDE2EFC [ -3] "AccountPR\ 0"
SWORD -3
WCHAR * 0x74329A38 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x74329A38 [ -3] "******\ 0"
SWORD -3

crw32 9d0-eb0 EXIT SQLConnectW with return code 1 (SQL_SUCCESS_WITH_INFO)
HDBC 05AF15E8
WCHAR * 0x7FDE2EFC [ -3] "AccountPR\ 0"
SWORD -3
WCHAR * 0x74329A38 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x74329A38 [ -3] "******\ 0"
SWORD -3

DIAG [01000] [Microsoft][ODBC Driver Manager] The driver doesn't support the version of ODBC behavior that the application requested (see SQLSetEnvAttr). (0)

=========But, it does work even with the error message.===

I've tried adding in the registry under:
HKLM, Software, ODBC, ODBC.INI, <Insert System DSN Here>.

I've also tried to add UID and PWD to the registry, but it doesn't work. I still get the logon box.

Any ideas?
 
Clearly the two versions are behaving differently in their use of the datasource. v8.5 is using SQLDriverConnect, while the later versions are using SQLConnect. These two API calls are not identical.

The SQLDriverConnect parameter that is supposed to have the full connection string does not appear to have all the information (datasource name, user name, and password) in it, so that is why the datasource is prompting for these things.

However, it also seems clear that the SQLConnect is not passing these things either. Note this:
Code:
crw32           9d0-eb0    ENTER SQLSetConnectAttrW
        SQLHDBC             05AF15E8
        SQLINTEGER                 111 <SQL_ATTR_QUIET_MODE>
        SQLPOINTER          00000000
        SQLINTEGER                  -3
The effect of this call is to tell the datasource not to display any dialog boxes (due to the passing of a null pointer). v8.5 doesn't do this, because it is using SQLDriverConnect and SQL_QUIET_MODE does not apply to SQLDriverConnect.

Also, you noted the following:
Code:
        DIAG [01000] [Microsoft][ODBC Driver Manager] The driver doesn't support the version of ODBC behavior that the application requested (see SQLSetEnvAttr).
This is normal. ODBc is a negotiated interface between the client and the datasource, and this is part of the negotiation.

So, not being a CR expert, I am unable to tell you how to get v8.5 to behave like its younger sibling. I would poke around anything that has to do with 'connection options' or 'connection parameters'.

Tom Morrison
 
Memento,

Are you using the reports directly from CR or through a VB (or other language) application?

If from VB then the following FAQ may help you.
faq149-4202

If doing it directly from CR, if you can make available a DEMO/EVALUATION version of CR8 to myself, then I might be able to test it and find the issue with it. I do remember a problem with it long time ago (other Relativity version), but I dont have CR8 anymore.

For your info I have been doing tech support for Liant in Portugal over the last 12 (or more) years.



Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
k5tm,

>>Clearly the two versions are behaving differently in their use of the datasource. v8.5 is using SQLDriverConnect, while the later versions are using SQLConnect. These two API calls are not identical.


This got me thinking. I went to Microsoft's website and found the following:

"When using SQLDriverConnect, there are two options for prompting the user for any needed connection information:

Application dialog box
You can create an application dialog box that prompts for connection information, and then calls SQLDriverConnect with a NULL window handle and DriverCompletion set to SQL_DRIVER_NOPROMPT. These parameter settings prevent the ODBC driver from opening its own dialog box. This method is used when it is important to control the user interface of the application."

Here's what I did:

In Crystal 8.5, open the Data Explorer. I used the Report Expert, and choose Database. When the Data Explorer appeared, I select:

Data Explorer, More Data Sources, OLE DB, Make New Connection, Add.

Next,
The Data Link Properties form appeared.

Provider - Tab
Choose Microsoft OLE DB Provider for ODBC Drivers
Click Next

Connection - Tab
1. Specifiy the source name - Choose your System DSN

Click OK.

This works!

It sets the SQLDriverConnectW to <SQL_DRIVER_NOPROMPT> instead of <SQL_DRIVER_COMPLETE>.

Here's the ODBC Traces.

Old Trace that would prompt yoy for a UID and PWD.

crw32 78-3a4 ENTER SQLDriverConnectW
HDBC 024D15E8
HWND 006B0518
WCHAR * 0x74329A38 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x74329A38
SWORD 2
SWORD * 0x00000000
UWORD 1 <SQL_DRIVER_COMPLETE>

Using OLE DB <==This works!

crw32 a90-ab4 ENTER SQLDriverConnectW
HDBC 026D1690
HWND 00000000
WCHAR * 0x74329A38 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x74329A38
SWORD 2
SWORD * 0x00000000
UWORD 0 <SQL_DRIVER_NOPROMPT>

Thanks for all the help.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top