Page 7 of 14
Posted: Sun May 13, 2007 8:36 pm
by Antonio Linares
Enrico,
Please place some traces in adordd.prg to check where/why it is failing:
The connection is opened here:
Code: Select all | Expand
case aWAData[ WA_ENGINE ] == "SQL"
aWAData[ WA_CONNECTION ]:Open( "Provider=SQLOLEDB;" + ;
"server=" + aWAData[ WA_SERVER ] + ;
";database=" + aOpenInfo[ UR_OI_NAME ] + ;
";uid=" + aWAData[ WA_USERNAME ] + ;
";pwd=" + aWAData[ WA_PASSWORD ] )
How to check that the Open msg worked ?
MsgInfo( aWAData[ WA_CONNECTION ]: ??? )
The table is opened here:
Code: Select all | Expand
oRecordSet:Open( aWAData[ WA_QUERY ] + aWAData[ WA_TABLENAME ], aWAData[ WA_CONNECTION ] )
How to check that the Open msg worked ?
MsgInfo( oRecordSet: ??? )
Posted: Sun May 13, 2007 8:39 pm
by Rick Lipkin
Enrico
Pay special attention to the database password .. My Database admin gave me a password that was mixed case .. however when I used it exactically as he gave it to me .. it failed .. I got lucky by putting the password all in lowercase and it worked ..
Rick Lipkin
Posted: Sun May 13, 2007 8:51 pm
by Enrico Maria Giordano
It won't work with ADO as well. It seems that I can't access that database from client side but only from a server side script.
Now I will try using my local MSDE...
EMG
Posted: Sun May 13, 2007 8:51 pm
by Rick Lipkin
Antonio
Got a return value of 1
Rick Lipkin
Posted: Sun May 13, 2007 9:03 pm
by Enrico Maria Giordano
What is supposed to translate the following connection string?
Code: Select all | Expand
oRs:Open( "SELECT * FROM Contatti", "Provider=SQLOLEDB;Integrated Security=SSPI;Data Source=EMAG\Emag;Initial Catalog=Ecmp", adOpenForwardOnly, adLockOptimistic )
I tried
Code: Select all | Expand
USE "Ecmp" VIA "ADORDD" TABLE "CONTATTI" FROM "\\EMAG\EMAG" USER "" PASSWORD "" SQL
but getting
Error description: Error ADODB.Connection/16389 E_FAIL: OPEN
at
ADO_OPEN(248)
EMG
Posted: Sun May 13, 2007 9:19 pm
by Enrico Maria Giordano
If I omit
then I get
Error description: Error BASE/1081 Argument error: +
at
ADO_OPEN(248)
EMG
Posted: Sun May 13, 2007 9:25 pm
by Antonio Linares
Enrico,
What is supposed to translate the following connection string?
Code: Select all | Expand
oRs:Open( "SELECT * FROM Contatti", "Provider=SQLOLEDB;Integrated Security=SSPI;Data Source=EMAG\Emag;Initial Catalog=Ecmp", adOpenForwardOnly, adLockOptimistic )
You have to modify adordd.prg to use that connection string
Posted: Sun May 13, 2007 9:29 pm
by Antonio Linares
Enrico,
> USER "" PASSWORD ""
What Args do you get at the error.log for the Argument error: + ?
Posted: Sun May 13, 2007 9:30 pm
by Enrico Maria Giordano
Application
===========
Path and name: C:\FWHARB\ADOTEST.EXE (32 bits)
Size: 1,208,832 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 05/13/07, 23:29:50
Error description: Error BASE/1081 Argument error: +
Args:
[ 1] = C Provider=SQLOLEDB;server=\\EMAG\EMAG;database=Ecmp;uid=
[ 2] = U
Stack Calls
===========
Called from: adordd.prg => ADO_OPEN(248)
Called from: => DBUSEAREA(0)
Called from: ADOTEST.prg => MAIN(12)
System
======
CPU type: AMD Sempron(TM) 2800+ 1983 Mhz
Hardware memory: 512 megs
Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %
Compiler version: Harbour devel build 1.1-0 Intl.
Windows version: 5.1, Build 2600 Service Pack 2
Windows total applications running: 0
Variables in use
================
Procedure Type Value
==========================
ADO_OPEN
Param 1: N 1
Param 2: A Len: 8
Local 1: A Len: 14
Local 2: C "Ecmp"
Local 3: U
Local 4: U
Local 5: U
Local 6: U
Local 7: U
Local 8: U
Local 9: S
Local 10: O Class: TOLEAUTO
Local 11: C "Provider=SQLOLEDB;server=\\EMAG\EMAG;database=Ecmp;uid="
Local 12: U
Local 13: N 0
DBUSEAREA
Param 1: L .F.
Param 2: C "ADORDD"
Param 3: C "Ecmp"
Param 4: U
Param 5: U
Param 6: L .F.
MAIN
Linked RDDs
===========
DBF
DBFFPT
DBFNTX
DBFBLOB
ADORDD
DataBases in use
================
Classes in use:
===============
1 HBCLASS
2 TOLEAUTO
3 ERROR
4 HBOBJECT
5 TREG32
Memory Analysis
===============
127 Static variables
Dynamic memory consume:
Actual Value: 0 bytes
Highest Value: 0 bytes
EMG
Posted: Sun May 13, 2007 9:30 pm
by Antonio Linares
Rick,
Ok, now try this, please:
MsgInfo( HB_AdoRddGetCatalog():Tables( cTableName ):Indexes( 0 ):Name )
Posted: Sun May 13, 2007 9:32 pm
by Antonio Linares
Enrico,
The userid is nil. Please change this into adordd.prg:
static bError, s_cTableName, s_cEngine, s_cServer, s_cUserName := "", s_cPassword := "", s_cQuery := ""
Posted: Sun May 13, 2007 9:40 pm
by Enrico Maria Giordano
Yes, now I get the usual
Error description: Error ADODB.Connection/16389 E_FAIL: OPEN
But I understood that trusted connection is not currently supported by ADORDD.
EMG
Posted: Sun May 13, 2007 9:42 pm
by Antonio Linares
Enrico,
How do you use a trusted connection with standard ADO ?
Posted: Sun May 13, 2007 9:46 pm
by Rick Lipkin
Enrico
//---
oRs:Open( "SELECT * FROM Contatti", "Provider=SQLOLEDB;Integrated Security=SSPI;Data Source=EMAG\Emag;Initial Catalog=Ecmp", adOpenForwardOnly, adLockOptimistic )
//---
Source is the IP or DNS name of the server
cFROM := "EMAG\Emag" // not a servername .. looks like a folder
cUSER := "???"
cPSW := " PASSWORD " // will get alltrimmed
cDBF := "ECMP"
cTable := "Contatti"
TRY
SELECT 1
USE (AllTrim(cDbf)) VIA "ADORDD" TABLE AllTrim(cTable) SQL ;
FROM AllTrim(cFrom) USER AllTrim(cUser) PASSWORD AllTrim(cPsw)
CATCH oERR
MsgInfo( "Error in Opening table" )
RETURN(.F.)
END TRY
//----------------
Plug in the name of the Server or IP .. select a user and password who have rights to the database. ( Security=SSPI .. need a user and password )
Hope this helps
Rick Lipkin
Posted: Sun May 13, 2007 9:54 pm
by Rick Lipkin
Antonio
The string returns :
userid
which is the name of the index I have on the Userinfo table ..
Rick Lipkin