New AdoRDD (free)

Post Reply
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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

      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

   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
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Post 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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post 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
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Post by Rick Lipkin »

Antonio

Got a return value of 1 :D

Rick Lipkin
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

What is supposed to translate the following connection string?

Code: Select all

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

Code: Select all

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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

If I omit

Code: Select all

USER "" PASSWORD ""
then I get
Error description: Error BASE/1081 Argument error: +
at
ADO_OPEN(248)
EMG
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Enrico,
What is supposed to translate the following connection string?

Code: Select all

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Enrico,

> USER "" PASSWORD ""

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

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Rick,

Ok, now try this, please:

MsgInfo( HB_AdoRddGetCatalog():Tables( cTableName ):Indexes( 0 ):Name )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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 := ""
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Enrico,

How do you use a trusted connection with standard ADO ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Post 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
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Post by Rick Lipkin »

Antonio

The string returns :

userid :D

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

Rick Lipkin
Post Reply