It is currently Wed Jun 20, 2018 10:37 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Problem with SQLConnect_() in PB5.61 (5.60 is fine)
PostPosted: Wed Jan 10, 2018 3:07 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Oct 21, 2010 9:46 pm
Posts: 120
Just run into an issue with some existing code where the Windows API call SQLConnect_() fails to connect to the database for code compiled with 5.61 x64.

Reverting to 5.60, and everything is fine, compiler options unchanged. Install 5.61 again, and the problem is back.

The code is this kind of thing:

Code:
retCode.w = SQLConnect_(*thisDBC\hDbc, @dbName$, Len(dbName$), @dbUser$, Len(dbUser$), @dbPass$, Len(dbPass$))


(It's derived from the code here: viewtopic.php?f=5&t=43322 )

When it works, you get a sensible return code and can proceed as normal. When it fails, you get #SQL_ERROR (-1) as the return code, but nothing else particularly useful. GetLastError_() usually returns "The operation completed successfully."

As the problem can be consistently reproduced or fixed by going back and forth between 5.60 and 5.61, and 5.61 is only supposed to be a bug fix release, I don't think there's anything amiss with the code.

Any known issues with 5.61 or things that might cause this kind of change in behaviour?


Top
 Profile  
Reply with quote  
 Post subject: Re: Problem with SQLConnect_() in PB5.61 (5.60 is fine)
PostPosted: Thu Jan 11, 2018 11:12 am 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 1254
Location: Germany
Show this bug report...

viewtopic.php?f=4&t=69462#p514276

_________________
My Projects OOP-BaseClass / OOP-BaseClassDispatch / Event-Designer /
PB v3.30 / v5.60 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: Problem with SQLConnect_() in PB5.61 (5.60 is fine)
PostPosted: Thu Jan 11, 2018 11:29 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Oct 21, 2010 9:46 pm
Posts: 120
mk-soft wrote:
Show this bug report...

viewtopic.php?f=4&t=69462#p514276

Yes, that looks like the same kind of thing.

So "Fixed" means will be working again in 5.62? I've gone back to 5.60 for the time being.


Top
 Profile  
Reply with quote  
 Post subject: Re: Problem with SQLConnect_() in PB5.61 & 5.62 (5.60 is fin
PostPosted: Tue Feb 06, 2018 11:14 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Oct 21, 2010 9:46 pm
Posts: 120
Looks like this is not resolved in 5.62.

Going back to 5.60 again...


Top
 Profile  
Reply with quote  
 Post subject: Re: Problem with SQLConnect_() in PB5.61 (5.60 is fine)
PostPosted: Sun Feb 11, 2018 3:34 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 1254
Location: Germany
Confirm bug v5.62

ASM Output
Code:
extrn SQLAllocConnect
extrn SQLAllocEnv
extrn SQLAllocStmt
extrn SQLBindCol
extrn SQLConfigDataSourceW
extrn SQLConnect <- Bug
extrn SQLDisconnect
extrn SQLFetch
extrn SQLFreeConnect
extrn SQLFreeEnv
extrn SQLFreeStmt
extrn SQLInstallerErrorW
extrn SQLTables <- Bug


Workaround
Code:
; -----------------------------------------------------------------------------
; Bugfix ASCII, Unicode PB v5.4x and PB v5.6x
; By mk-soft version v1.02

Import "odbccp32.lib"
  CompilerIf #PB_Compiler_Unicode
    CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
      SQLInstallerError(iError, *pfErrorCode, *ErrorMSGBuf, cbErrorMsgMax, *ErrorMSGLen) As "_SQLInstallerErrorW@20"
      SQLConfigDataSource(Handle, Type, strDriver.s, *strAttribtues) As "_SQLConfigDataSourceW@16"
    CompilerElse
      SQLInstallerError(iError, *pfErrorCode, *ErrorMSGBuf, cbErrorMsgMax, *ErrorMSGLen) As "SQLInstallerErrorW"
      SQLConfigDataSource(Handle, Type, strDriver.s, *strAttribtues) As "SQLConfigDataSourceW"
    CompilerEndIf
  CompilerElse
    SQLInstallerError(iError, *pfErrorCode, *ErrorMSGBuf, cbErrorMsgMax, *ErrorMSGLen)
    SQLConfigDataSource(Handle, Type, strDriver.s, *strAttribtues)
  CompilerEndIf
EndImport

Import "odbc32.lib"
  CompilerIf #PB_Compiler_Unicode
    CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
      SQLConnect(ConnectionHandle, ServerName.s, NameLength1, UserName.s, NameLength2, Authentication.s, NameLength3) As "_SQLConnectW@28"
      SQLTables(StatementHandle, *CatalogName, NameLength1, *SchemaName, NameLength2, *TableName, NameLength3, *TableType, NameLength4) As "_SQLTablesW@36"
    CompilerElse
      SQLConnect(ConnectionHandle, ServerName.s, NameLength1, UserName.s, NameLength2, Authentication.s, NameLength3) As "SQLConnectW"
      SQLTables(StatementHandle, *CatalogName, NameLength1, *SchemaName, NameLength2, *TableName, NameLength3, *TableType, NameLength4) As "SQLTablesW"
    CompilerEndIf
  CompilerElse
    SQLConnect(ConnectionHandle, ServerName.s, NameLength1, UserName.s, NameLength2, Authentication.s, NameLength3)
    SQLTables(StatementHandle, *CatalogName, NameLength1, *SchemaName, NameLength2, *TableName, NameLength3, *TableType, NameLength4)
  CompilerEndIf 
EndImport
; -----------------------------------------------------------------------------

_________________
My Projects OOP-BaseClass / OOP-BaseClassDispatch / Event-Designer /
PB v3.30 / v5.60 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye