FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour New AdoRDD (free)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
New AdoRDD (free)
Posted: Sun May 13, 2007 08:36 PM
Enrico,

Please place some traces in adordd.prg to check where/why it is failing:

The connection is opened here:
      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:
   oRecordSet:Open( aWAData[ WA_QUERY ] + aWAData[ WA_TABLENAME ], aWAData[ WA_CONNECTION ] )

How to check that the Open msg worked ?
MsgInfo( oRecordSet: ??? )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
New AdoRDD (free)
Posted: Sun May 13, 2007 08:39 PM

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

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
New AdoRDD (free)
Posted: Sun May 13, 2007 08:51 PM

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

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
New AdoRDD (free)
Posted: Sun May 13, 2007 08:51 PM

Antonio

Got a return value of 1 :D

Rick Lipkin

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
New AdoRDD (free)
Posted: Sun May 13, 2007 09:03 PM
What is supposed to translate the following connection string?

oRs:Open( "SELECT * FROM Contatti", "Provider=SQLOLEDB;Integrated Security=SSPI;Data Source=EMAG\Emag;Initial Catalog=Ecmp", adOpenForwardOnly, adLockOptimistic )


I tried

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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
New AdoRDD (free)
Posted: Sun May 13, 2007 09:19 PM
If I omit

USER "" PASSWORD ""


then I get

Error description: Error BASE/1081 Argument error: +


at

ADO_OPEN(248)


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
New AdoRDD (free)
Posted: Sun May 13, 2007 09:25 PM
Enrico,

What is supposed to translate the following connection string?

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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
New AdoRDD (free)
Posted: Sun May 13, 2007 09:29 PM

Enrico,

> USER "" PASSWORD ""

What Args do you get at the error.log for the Argument error: + ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
New AdoRDD (free)
Posted: Sun May 13, 2007 09:30 PM
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
New AdoRDD (free)
Posted: Sun May 13, 2007 09:30 PM

Rick,

Ok, now try this, please:

MsgInfo( HB_AdoRddGetCatalog():Tables( cTableName ):Indexes( 0 ):Name )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
New AdoRDD (free)
Posted: Sun May 13, 2007 09:32 PM
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 := ""
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
New AdoRDD (free)
Posted: Sun May 13, 2007 09:40 PM
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
New AdoRDD (free)
Posted: Sun May 13, 2007 09:42 PM

Enrico,

How do you use a trusted connection with standard ADO ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
New AdoRDD (free)
Posted: Sun May 13, 2007 09:46 PM

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

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
New AdoRDD (free)
Posted: Sun May 13, 2007 09:54 PM

Antonio

The string returns :

userid :D

which is the name of the index I have on the Userinfo table ..

Rick Lipkin