New AdoRDD (free)

Postby Antonio Linares » Sun May 13, 2007 8:36 pm

Enrico,

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

The connection is opened here:
Code: Select all  Expand view
      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 view
   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
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Rick Lipkin » Sun May 13, 2007 8: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby Enrico Maria Giordano » Sun May 13, 2007 8: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
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Rick Lipkin » Sun May 13, 2007 8:51 pm

Antonio

Got a return value of 1 :D

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby Enrico Maria Giordano » Sun May 13, 2007 9:03 pm

What is supposed to translate the following connection string?

Code: Select all  Expand view
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 view
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: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Enrico Maria Giordano » Sun May 13, 2007 9:19 pm

If I omit

Code: Select all  Expand view
USER "" PASSWORD ""


then I get

Error description: Error BASE/1081 Argument error: +


at

ADO_OPEN(248)


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Sun May 13, 2007 9:25 pm

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

Code: Select all  Expand view
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: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Sun May 13, 2007 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Sun May 13, 2007 9: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
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Sun May 13, 2007 9:30 pm

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: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Sun May 13, 2007 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Sun May 13, 2007 9: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
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Sun May 13, 2007 9:42 pm

Enrico,

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

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

Postby Rick Lipkin » Sun May 13, 2007 9: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby Rick Lipkin » Sun May 13, 2007 9:54 pm

Antonio

The string returns :

userid :D

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

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 22 guests