I have a local connection with a Firebird database using an OleDB provider.
Locally I can do all the things I want, but when I change the connection string to my server, he succesfully connects to database but I receive an error (see the following code):
Public PConnect
PConnect = Createobject('ADODB.Connection')
Wait Windows 'Estabelecendo conexão... Aguarde...' Nowait
* ===Local string connection===
*lstring = 'provider=iboledb;location=localhost:;character set=WIN1252;data *source=c:\rh\sgbd\rhsystem.gdb'
* ===Server string connection===
lstring = 'provider=iboledb;location=192.168.20.142:;character set=WIN1252;data source=\\douglas\público\rhsystem.gdb'string
PConnect.Open( lstring, "SYSDBA", "masterkey" )
Wait Clear
If PConnect.State # 1 Then
Messagebox('Não foi possível estabeler a conexão com o servidor de dados.', 64, 'Visual Folhamatic')
Return .F.
Else
Messagebox('Conexão bem sucedida', 64, 'Visual Folhamatic')
Endif
lObjUsuarioEcrm = Createobject('AdoDB.RecordSet')
lObjUsuarioEcrm.CursorLocation = 3
lObjUsuarioEcrm.CursorType = 2
lObjUsuarioEcrm.LockType = 4
lObjUsuarioEcrm.ActiveConnection = PConnect
***
lCarQuery = 'select * from colaboradores'
lObjUsuarioEcrm.Open( lCarQuery ) && ===Error occurs in this line!===
lObjUsuarioEcrm.movefirst
Do While !( lObjUsuarioEcrm.Eof )
Messagebox( lObjUsuarioEcrm.Fields( "colaborador" ).Value )
lObjUsuarioEcrm.movenext
Enddo
The error message is:
OLE IDispatch exception code 0 from IbOleDb: Dynamic SQL Error
-SQL error code = -901
-feature is not supported..
Please, someone can help me to solve this?
Emerson Santon Reed
"One Developer CAN Make a Difference. A community CAN make a future." - Craig Boyd