ADOmate - use OLE-DB datasources via ADO - (BLOBs added)
Re: ADOmate - use OLE-DB datasources via ADO - (BLOBs added)
http://dl.dropbox.com/u/3086026/ADOmate.zip should work for a short time
I hope srod will fix his webside.
I hope srod will fix his webside.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Re: ADOmate - use OLE-DB datasources via ADO - (BLOBs added)
He is a lazy bugger at the best of times!ts-soft wrote:I hope srod will fix his webside.
I'll get on to it tonight... if I can find it!
I may look like a mule, but I'm not a complete ass.
Re: ADOmate - use OLE-DB datasources via ADO - (BLOBs added)
I just clicked the dropbox url and it downloaded w/o issue.coelhorb wrote:Please could you put ADOmate link available again? http://dl.dropbox.com/u/3086026/ADOmate.zip doesn't work any more and I can't find it anywhere on internet. The nxsoftware's site is out. Thanks and sorry for my poor english.
I mirrored it here: http://jassing.com/temp/adomate.zip -- but this doesn't mean it'll be there forever...
adomate is 3 years old...
Re: ADOmate - use OLE-DB datasources via ADO - (BLOBs added)
Thanks, it will help me a lot.
Re: ADOmate - use OLE-DB datasources via ADO - (BLOBs added)
And http://www.nxsoftware.com/ is working again
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Re: ADOmate - use OLE-DB datasources via ADO - (BLOBs added)
Yes, but most of the links aren't!ts-soft wrote:And http://www.nxsoftware.com/ is working again
I may look like a mule, but I'm not a complete ass.
Re: ADOmate - use OLE-DB datasources via ADO - (BLOBs added)
hi, srod.
I'd like to suggest some fixes for using ADOMate with the Windows x64 compiler.
First, as I read in another topic, the EXCEPINFO structure is different in the x64 library so I'd suggest
a code in COMate like this one:
Next, there is something wrong when the IDispatch\Invoke is called in the x64 version. There must be an additional error code for this version because every connection that should have caused an error returns "Okay.". I haven't tested it thoroughly but here's what I saw:
Replacing the first code with the second one should do the trick for every version:
I hope that helps. With the changes above my code is working great in x86 and x64 versions.
BTW, thank you for this wonderful library.
EDIT: After more time debugging I think the problem resides in a deeper level. The COMateClass_INTERNAL_InvokePlus method returns a negative error number in the x86 compiler while it returns a positive one in x64. That's why the SUCCEEDED macro above always returns TRUE.
Best regards,
Andre Guerreiro Neto
I'd like to suggest some fixes for using ADOMate with the Windows x64 compiler.
First, as I read in another topic, the EXCEPINFO structure is different in the x64 library so I'd suggest
a code in COMate like this one:
Code: Select all
;The following structure is used in the iDispatch\Invoke() method call to receive detailed errors.
CompilerIf Defined(EXCEPINFO, #PB_Structure) = 0
CompilerIf #PB_Compiler_Processor = #PB_Processor_x64
Structure EXCEPINFO
wCode.w
wReserved.w
pad.b[4] ; Only on x64
bstrSource.i ;BSTR
bstrDescription.i
bstrHelpFile.i
dwHelpContext.l
pvReserved.i
pfnDeferredFillIn.COMate_ProtoDeferredFillIn
scode.l
pad2.b[4] ; Only on x64
EndStructure
CompilerElse
Structure EXCEPINFO
wCode.w
wReserved.w
bstrSource.i ;BSTR
bstrDescription.i
bstrHelpFile.i
dwHelpContext.l
pvReserved.i
pfnDeferredFillIn.COMate_ProtoDeferredFillIn
scode.l
EndStructure
CompilerEndIf
CompilerEndIf
Replacing the first code with the second one should do the trick for every version:
Code: Select all
; ADOmate_OpenDatabase method - Line 1099
If SUCCEEDED(*connection\connectionObject\Invoke("Open('" + connection$ + "', " + user$ + ", " + password$ +")"))
Code: Select all
; ADOmate_OpenDatabase method - Line 1099
If *connection\connectionObject\Invoke("Open('" + connection$ + "', " + user$ + ", " + password$ +")") = #S_OK
I hope that helps. With the changes above my code is working great in x86 and x64 versions.
BTW, thank you for this wonderful library.
EDIT: After more time debugging I think the problem resides in a deeper level. The COMateClass_INTERNAL_InvokePlus method returns a negative error number in the x86 compiler while it returns a positive one in x64. That's why the SUCCEEDED macro above always returns TRUE.
Best regards,
Andre Guerreiro Neto
Proud registered Purebasic user.
Because programming should be fun.
Because programming should be fun.
Re: ADOmate - use OLE-DB datasources via ADO - (BLOBs added)
Thanks byo, good work there.
I wonder if the problem with the error codes is that HRESULT values are actually 32-bit regardless of architecture? If this is the case then PBx64 could be misinterpreting the return values? Will need to get ahold of some c header files to be sure.
EDIT : yes I do think that PB x64 regards HRESULT as 64-bit integers rather than 32-bit longs. This would mean that PB x64 has all in-built interface methods which return HRESULT values incorrect.
I can easily add a workaround to COMate.
**EDIT : COMatePLUS workaround.
This is only valid whilst the conjectured bug with PB stands.
I wonder if the problem with the error codes is that HRESULT values are actually 32-bit regardless of architecture? If this is the case then PBx64 could be misinterpreting the return values? Will need to get ahold of some c header files to be sure.
EDIT : yes I do think that PB x64 regards HRESULT as 64-bit integers rather than 32-bit longs. This would mean that PB x64 has all in-built interface methods which return HRESULT values incorrect.
I can easily add a workaround to COMate.
**EDIT : COMatePLUS workaround.
Code: Select all
Macro SUCCEEDED(HRESULT)
HRESULT & $80000000 = 0
EndMacro
Macro FAILED(HRESULT)
HRESULT & $80000000
EndMacro
Last edited by srod on Sat Nov 03, 2012 9:16 am, edited 1 time in total.
I may look like a mule, but I'm not a complete ass.
Re: ADOmate - use OLE-DB datasources via ADO - (BLOBs added)
Ah, so that's what's going on.EDIT : yes I do think that PB x64 regards HRESULT as 64-bit integers rather than 32-bit longs. This would mean that PB x64 has all in-built interface methods which return HRESULT values incorrect.
Thank you for your additional tests.
Interesting macro solution.
I have tested your fix in both compilers and both produce the correct output.
Should we inform Fred/freak about the issue or is there a bug report already filled?
[EDIT]: I was using only your macro solution without my altered code and it would still fail to show an error. Only when I changed the ADOmate line to compare the Invoke method result with #S_OK it would work properly for me in x64.
Thanks again, Stephen.
Best regards,
Andre Guerreiro Neto
Proud registered Purebasic user.
Because programming should be fun.
Because programming should be fun.
Re: ADOmate - use OLE-DB datasources via ADO - (BLOBs added)
You need to replace the original macro in COMatePLUS with the new one given above. I will post a bug report later.
*EDIT : sorry, the macro above was wrong, please try again with the new version.
*EDIT : sorry, the macro above was wrong, please try again with the new version.
I may look like a mule, but I'm not a complete ass.
Re: ADOmate - use OLE-DB datasources via ADO - (BLOBs added)
Thank you, srod.
It's working correctly now. I see what you did there but I can't quite understand it. I'm not good in Bitwise operators.
Nice work there.
Thanks again for the easy fix.
Best regards,
Andre Guerreiro Neto
It's working correctly now. I see what you did there but I can't quite understand it. I'm not good in Bitwise operators.
Nice work there.
Thanks again for the easy fix.
Best regards,
Andre Guerreiro Neto
Proud registered Purebasic user.
Because programming should be fun.
Because programming should be fun.
Re: ADOmate - use OLE-DB datasources via ADO - (BLOBs added)
Hi. mr. srod. How's it going?
I have an improvement to suggest. How about adding a new parameter to ADOMate_DatabaseQuery to set the cursorLocation property for the RecordSet?
This can have a huge impact on queries depending on the case, of course. Sometimes, when the cursor is executed at the client side it's faster and takes the burden off the server.
The changes you'd have to make (if you accept it) is:
Even if you can change that property later, the reason I ask this is because one has to close the connection to be able to change that property and then reopen it so the change will take effect.
Best regards,
Andre Guerreiro Neto
I have an improvement to suggest. How about adding a new parameter to ADOMate_DatabaseQuery to set the cursorLocation property for the RecordSet?
This can have a huge impact on queries depending on the case, of course. Sometimes, when the cursor is executed at the client side it's faster and takes the burden off the server.
The changes you'd have to make (if you accept it) is:
Code: Select all
; The declaration:
Procedure.i ADOmate_DatabaseQuery(*connection._ADOmateConnection, request$, cursorType = #adOpenForwardOnly, cursorLocation = #adUseServer)
Code: Select all
; The definition (line 423):
If rset\SetProperty("CursorType = " + Str(cursorType)) = #S_OK And rset\SetProperty("CursorLocation = " + Str(cursorLocation)) = #S_OK And rset\Invoke("Open('" + request$ + "', " + Str(*connection\connectionObject) + " As COMateObject)") = #S_OK
Best regards,
Andre Guerreiro Neto
Proud registered Purebasic user.
Because programming should be fun.
Because programming should be fun.
Re: ADOmate - use OLE-DB datasources via ADO - (BLOBs added)
Hello,
i tried to use ADOmate to connect to password protected .mdb and .accdb, but failed.
it works great for unprotected .mdb.
here's my code
i tried to use ADOmate to connect to password protected .mdb and .accdb, but failed.
it works great for unprotected .mdb.
here's my code
Code: Select all
;/////////////////////////////////////////////////////////////////////////////////
;***ADOmate*** - access to OLEDB datasources.
;*============
;*
;*Database query demo.
;*This demo requires the "ado.mdb" database file.
;/////////////////////////////////////////////////////////////////////////////////
IncludePath "..\"
XIncludeFile "ADOmate.pbi"
databaseFile$ = "D:\test.mdb"
connectionString$ = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + databaseFile$ + ";"
User$ = ""
Password$ = "test"
;Attempt to open the database.
myConnection = ADOmate_OpenDatabase(connectionString$,User$,Password$)
If myConnection
;Attempt to execute a basic query.
SQL$ = "Select * from Test"
If ADOmate_DatabaseQuery(myConnection, SQL$, #adOpenStatic)
;Let us display a list of columns.
numColumns = ADOmate_DatabaseColumns(myConnection)
If numColumns
Debug "Columns : "
Debug "--------------"
For i = 0 To numColumns-1
Debug " " + ADOmate_DatabaseColumnName(myConnection, i) + " --> column type = " + Str(ADOmate_DatabaseColumnType(myConnection, i))
Next
Debug ""
EndIf
;Now examine all records retrieved in the recordset.
Debug "Rows : "
Debug "--------------"
While ADOmate_IsEOF(myConnection) = 0
ID$ = ADOmate_GetDatabaseString(myConnection, 0)
Integer$ = ADOmate_GetDatabaseString(myConnection, 1)
Text$ = ADOmate_GetDatabaseString(myConnection, 2)
Memo$ = ADOmate_GetDatabaseString(myConnection, 3)
Debug " (ID=" + ID$ + ", IntegerField=" + Integer$ + ", TextField=" + Text$ + ", MemoField=" + Memo$ + ")"
ADOmate_NextDatabaseRow(myConnection)
Wend
ADOmate_FinishDatabaseQuery(myConnection)
Else
MessageRequester("ADOmate error!", ADOmate_GetLastErrorDescription())
EndIf
ADOmate_CloseDatabase(myConnection)
Else
MessageRequester("ADOmate error!", ADOmate_GetLastErrorDescription())
EndIf
Re: ADOmate - use OLE-DB datasources via ADO - (BLOBs added)
you must set your password in the Connectionstring:
Greetings ... Kiffi
Code: Select all
[...]
connectionString$ = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + databaseFile$ + ";Jet OLEDB:Database Password=test"
;Attempt to open the database.
myConnection = ADOmate_OpenDatabase(connectionString$, "", "")
[...]
Hygge
Re: ADOmate - use OLE-DB datasources via ADO - (BLOBs added)
Your code works great for .mdb
but it still can't connect to unprotected and protected .accdb, its said unrecognized database format.
Thank you very much for the lib srod and the correction Kiffi
but it still can't connect to unprotected and protected .accdb, its said unrecognized database format.
Thank you very much for the lib srod and the correction Kiffi