Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #1348 > unrolled thread

Accessing ADS file on internet

Started byD.J.W. van Kooten <public@ic2remove.this.com>
First post2011-06-10 21:18 +0200
Last post2011-06-13 07:43 -0500
Articles 4 — 3 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Accessing ADS file on internet D.J.W. van Kooten <public@ic2remove.this.com> - 2011-06-10 21:18 +0200
    Re: Accessing ADS file on internet "richard.townsendrose" <richard.townsendrose@gmail.com> - 2011-06-13 01:05 -0700
      Re: Accessing ADS file on internet D.J.W. van Kooten <public@ic2remove.this.com> - 2011-06-14 09:06 +0200
    Re: Accessing ADS file on internet "Willie Moore" <williem@wmconsulting.com> - 2011-06-13 07:43 -0500

#1348 — Accessing ADS file on internet

FromD.J.W. van Kooten <public@ic2remove.this.com>
Date2011-06-10 21:18 +0200
SubjectAccessing ADS file on internet
Message-ID<kcq4v65k2ntjpjg1g4vrca02b5vvpdd2jd@4ax.com>
We try to access a databasefile on our website from a PC with ADS
Server loaded, but we most likely miss a step (or 2) because it fails
from the beginning. I try with a test program from Marc Verkade,
basically I did the following:

1 On the PC I created a data dictionary containing 1 dbf. Uploaded all
data (Add, dbf, cdx,ai and am) to our website. Enable internet access
is checked
2 On our Advantage Configuration utility we set up post 2001 to be the
internet port.
3 We  run the program. First the file is constructed like this:
sFile:="\\192.168.0.101:2001\adstest\adstest.add"

(where the ip address is the on of our website instead)

First, the test program asks for File(sFile) 
I was wondering how that could work? In my case it didn't...

Then these 3 lines run:

// Check the connection:
usLoaded:=0
ulRetVal:=DWORD(_CAST,DBFAXSAdsIsServerLoaded(String2Psz(sFile),@usLoaded))


There I do get error 6420 = Unable to discover ADS

But ADS is active (not on the website which is supposed not to be
required, but the PC)!

The trying to connect:

AdsConnect60( String2Psz(sConnect) , ADS_AIS_SERVER,
String2Psz(sUser), String2Psz(sPass), ADS_DEFAULT, @hConnect 

I get error 
6610 No port specific in the connection string (which Idid supply)
followed by 5033 No connected server was found on the given drive
letter on trying to assign the server.

What step(s) do I miss

Dick

[toc] | [next] | [standalone]


#1373

From"richard.townsendrose" <richard.townsendrose@gmail.com>
Date2011-06-13 01:05 -0700
Message-ID<dd1551e8-26f5-4847-9dd6-46bf4d4edc6a@s9g2000yqm.googlegroups.com>
In reply to#1348
Dick

you must have ADS running on the server of course ...

start and and try linking in with the data architect. if that works
then mechanically the link is there and all you have to do is write
some code.

it is probably one of those daft wee things that get all of us from
time to time ... here's our code: do verify calls fixtext which makes
the connection path.

****************************

METHOD DoVerify( ) CLASS InternetPath
	LOCAL uRetVal  AS DWORD
	LOCAL hConnect AS DWORD
	LOCAL oSY AS SYServerV4
	LOCAL cVersion AS STRING
	LOCAL cMsg:='' AS STRING
	LOCAL dwColr AS DWORD

//	SELF:oCCDoSave:Disable()
	SELF:FixText()

	IF Empty(SELF:oDCIPAddress:VALUE) .OR. ;
		Empty(SELF:oDCIPPort:VALUE) .OR. ;
		Empty(SELF:oDCIPDrive:VALUE) .OR. ;
		Empty(SELF:oDCIPPath:VALUE)

	ELSE

		// Set the connections, allow only nternet
		AX_SetServerType(FALSE,TRUE,FALSE)

		// make connection
		uRetVal:=AdsConnect60( String2Psz(AllTrim(SELF:cConnPath)) ,
ADS_AIS_SERVER, String2Psz(AllTrim(ADSUserName)),
String2Psz(AllTrim(ADSUserPassword)), ADS_DEFAULT, @hConnect )

		IF ! uRetVal == AE_Success
			DO CASE
				CASE uRetVal == 7078
					cMsg:='Invalid User Name or Password'
			ENDCASE
			cMsg:="Advantage Error No: " + AsString(uRetVal)  + CRLF + cMsg
			dwColr:=COLORRED
		ELSE
			/* Set the connection handle */
			AX_SetConnectionHandle( hConnect )
			oSY:=SYServerV4{}
			IF oSY:Used
				// version check
				IF oSY:Seek(Version)
					cVersion:=AllTrim(oSY:FIELDGET(#PARAMDATA))
					IF SubStr(cVersion,1,4) == SubStr(_TDOC_VERSION + '.'
+_TDOC_MAJORRELEASE, 1,4)
						IF oSY:RECCOUNT == NumOfParams // Correlates with No of
Parameters set in Params:LoadDefault()
							cMsg:='Version Correct: ' + cVersion + CRLF + 'No of parameters
Correct: '+ NTrim(oSY:RECCOUNT)
							dwColr:=COLORBLUE
							SELF:oCCDoSave:Enable()
						ELSE
							cMsg:='Version Correct: ' + cVersion + CRLF + 'No of parameters
required: ' + NTrim(NumOfParams) + CRLF + 'Found: ' +
NTrim(oSY:RECCOUNT)
							dwColr:=COLORYELLOW
						ENDIF
					ELSE
						cMsg:='Version Error' + CRLF + 'Software: ' +
SubStr(_TDOC_VERSION + '.' +_TDOC_MAJORRELEASE, 1,4) + CRLF + 'Data: '
+ cVersion
						dwColr:=COLORYELLOW
					ENDIF
				ELSE
					cMsg:='Missing Version Paramater' + CRLF + 'Failed to locate
Version'
					dwColr:=COLORYELLOW
				ENDIF
  			ELSE
				cMsg:='Failed to connect to Parameters'
				dwColr:=COLORRED
			ENDIF

			oSY:Close()
			AdsDisconnect(hConnect)
		ENDIF

		AX_SetConnectionHandle( 0 )
		SELF:oDCStatusInfo:VALUE:=cMsg
		SELF:oDCStatusInfo:TextColor := Color{dwColr}

	ENDIF

RETURN NIL

*****************

METHOD FixText(symName) CLASS InternetPath
	LOCAL n AS DWORD
	LOCAL cStr:='' AS STRING

	SELF:oCCDoSave:Disable()
	SELF:oDCStatusInfo:VALUE:='Unknown' + CRLF + 'Please verify'
	SELF:oDCStatusInfo:TextColor:=Color{COLORBLACK}

	FOR n:=1 TO SLen(AllTrim(SELF:oDCIPAddress:VALUE))
		IF Instr(SubStr(SELF:oDCIPAddress:VALUE,n,1) , '1234567890.')
			cStr:=cStr+SubStr(SELF:oDCIPAddress:VALUE,n,1)
		ENDIF
	NEXT
	SELF:oDCIPAddress:VALUE:=cStr

	// stripout any '/' or '\' at start end for path
	DO WHILE Instr(SubStr(AllTrim(SELF:oDCIPPath:VALUE),1,1),'/\')
		SELF:oDCIPPath:VALUE:=SubStr(SELF:oDCIPPath:VALUE,2)
	ENDDO
	DO WHILE Instr(Right(AllTrim(SELF:oDCIPPath:VALUE),1),'/\')
		SELF:oDCIPPath:VALUE:=SubStr(SELF:oDCIPPath:VALUE,1,
SLen(AllTrim(SELF:oDCIPPath:VALUE))-1)
	ENDDO

	IF Empty(SELF:oDCIPAddress:VALUE) .OR. ;
		Empty(SELF:oDCIPPort:VALUE) .OR. ;
		Empty(SELF:oDCIPDrive:VALUE) .OR. ;
		Empty(SELF:oDCIPPath:VALUE)
		SELF:cConnPath:=''

	ELSE
		SELF:cConnpath:='//' + AllTrim(SELF:oDCIPAddress:VALUE) + ;
						':' + AllTrim(SELF:oDCIPPort:VALUE) + ;
						'\' + AllTrim(SELF:oDCIPDrive:VALUE) + ;
						'\' + AllTrim(SELF:oDCIPPath:VALUE) + ;
						'\' + ADSTDOCDD + '.add'
	ENDIF

	SELF:oCCDoVerify:ToolTipText:=SELF:cConnpath

RETURN NIL

*****************************

richard

[toc] | [prev] | [next] | [standalone]


#1394

FromD.J.W. van Kooten <public@ic2remove.this.com>
Date2011-06-14 09:06 +0200
Message-ID<fo1ev6174ehgnmvdvnu85kbmiekkpokliv@4ax.com>
In reply to#1373
On Mon, 13 Jun 2011 01:05:55 -0700 (PDT), "richard.townsendrose"
<richard.townsendrose@gmail.com> wrote:

Hello Richard,

Thanks for your remarks...
>
>you must have ADS running on the server of course ...


With server, I assume you mean: the server/PC from where you run the
program that opens the databases on the webserver, right? I've
understood I do not need to install ADS on the webserver, except when
programs accessing data run there.

>start and and try linking in with the data architect. if that works
>then mechanically the link is there and all you have to do is write
>some code.

That's a good idea. I'll start there and check out your program.

Willie, I will also check the ports. I though I'd try to create the
"internet" data on a local PC within the network to see if it works
from there.

I'll keep you posted.

Dick

[toc] | [prev] | [next] | [standalone]


#1374

From"Willie Moore" <williem@wmconsulting.com>
Date2011-06-13 07:43 -0500
Message-ID<it50m5$fo8$1@speranza.aioe.org>
In reply to#1348
Dick,

When you are trying to use databases over the internet, you have to make 
sure that your hosting site is configured correctly. The first thing that 
you must always check is that you have the ports (udp and tcp) enabled on 
the router. Most shops turn OFF all non-standard ports including the ones 
needed for MS-SQL. You have to make sure that they are enabled or your 
solution will not work.

Regards,
Willie

"D.J.W. van Kooten"  wrote in message 
news:kcq4v65k2ntjpjg1g4vrca02b5vvpdd2jd@4ax.com...

We try to access a databasefile on our website from a PC with ADS
Server loaded, but we most likely miss a step (or 2) because it fails
from the beginning. I try with a test program from Marc Verkade,
basically I did the following:

1 On the PC I created a data dictionary containing 1 dbf. Uploaded all
data (Add, dbf, cdx,ai and am) to our website. Enable internet access
is checked
2 On our Advantage Configuration utility we set up post 2001 to be the
internet port.
3 We  run the program. First the file is constructed like this:
sFile:="\\192.168.0.101:2001\adstest\adstest.add"

(where the ip address is the on of our website instead)

First, the test program asks for File(sFile)
I was wondering how that could work? In my case it didn't...

Then these 3 lines run:

// Check the connection:
usLoaded:=0
ulRetVal:=DWORD(_CAST,DBFAXSAdsIsServerLoaded(String2Psz(sFile),@usLoaded))


There I do get error 6420 = Unable to discover ADS

But ADS is active (not on the website which is supposed not to be
required, but the PC)!

The trying to connect:

AdsConnect60( String2Psz(sConnect) , ADS_AIS_SERVER,
String2Psz(sUser), String2Psz(sPass), ADS_DEFAULT, @hConnect

I get error
6610 No port specific in the connection string (which Idid supply)
followed by 5033 No connected server was found on the given drive
letter on trying to assign the server.

What step(s) do I miss

Dick 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web