Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

AdsCreateTable and local server

2 posts in FoxPro Last posting was on 2007-01-23 16:14:41.0Z
Adrian van der Merwe Posted on 2007-01-23 12:58:11.0Z
From: "Adrian van der Merwe" <adrianv@taly.net>
Newsgroups: advantage.foxpro
Subject: AdsCreateTable and local server
Date: Tue, 23 Jan 2007 14:58:11 +0200
Lines: 41
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 41.241.197.46
Message-ID: <45b60575@solutions.advantagedatabase.com>
X-Trace: 23 Jan 2007 05:54:13 -0700, 41.241.197.46
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!41.241.197.46
Xref: solutions.advantagedatabase.com Advantage.FoxPro:223
Article PK: 1109578

Hi all,

I am stumped by this and hoping for a little insight, or even a hint or
suggestion. I have code that creates tables in a data dictionary and it
works 100% when I am using the Database Server. However when using the local
server, it creates the table, but the name inside the ADD is incorrect.

Here is that piece of code:
Declare Long AdsCreateTable In ace32 ;
long ConnectHandle ,;
string TableName ,;
string AliasName ,;
long TableType ,;
long CharType ,;
long LockType ,;
long CheckRights ,;
long MemoSize ,;
string FieldDefs ,;
long @ TableHandle
...
imsg ( 'Creating ADS table: "'+TableName+'" len='+Str(Len(TableName)) )
result = AdsCreateTable
(handle,TableName,'',TableType,2,1,2,0,Fields,@handle1)
If result<>AE_SUCCESS
...


The result from the function is AE_SUCCESS. The table Settings.ADT is
created correctly, but inside the ADD it is Settings?

With different filenames the characters at the end change.

Thoughts?

--
Adrian van der Merwe
Taly Computer Solutions
Manager Software Development
adrianv@taly.net


Mark Wilkins Posted on 2007-01-23 16:14:41.0Z
From: "Mark Wilkins" <mark@no.email>
Newsgroups: advantage.foxpro
References: <45b60575@solutions.advantagedatabase.com>
Subject: Re: AdsCreateTable and local server
Date: Tue, 23 Jan 2007 09:14:41 -0700
Lines: 76
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 10.24.38.228
Message-ID: <45b6336d@solutions.advantagedatabase.com>
X-Trace: 23 Jan 2007 09:10:21 -0700, 10.24.38.228
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.228
Xref: solutions.advantagedatabase.com Advantage.FoxPro:224
Article PK: 1109579

Hi Adrian,

Can you provide a full re-creation of the problem? I tried it with the code
you provided, and it worked fine for me. The only thing I see that might be
wrong is some of the parameter declarations in the AdsCreateTable call.
They are declared as long but really should be short (16-bit integers). In
reality, I don't think that should cause a problem since they are passed by
value and I 'm sure 4 bytes are put on the stack for each variable
regardless, but that's the only thing I can see that might be an issue. The
following code is what I ran to test it.

Mark Wilkins
Advantage R&D



Declare Long AdsCreateTable In ace32 ;
long ConnectHandle ,;
string TableName ,;
string AliasName ,;
short TableType ,;
short CharType ,;
short LockType ,;
short CheckRights ,;
short MemoSize ,;
string FieldDefs ,;
long @ TableHandle


DECLARE long AdsConnect60 IN ace32 ;
string pucPath,;
short usServerTypes, ;
string pucUser, ;
string pucPassword, ;
long ulOptions, ;
long @phConnect

DECLARE long AdsDisconnect IN ace32 long hConnect

LOCAL TableName as String
LOCAL TableType as Integer
LOCAL hConn as Integer
LOCAL hTable as Integer
LOCAL fields as String


result = AdsConnect60( "x:\ddtest\test.add", 1, "adssys", "", 0, @hConn )
? "Result of connect = " + STR( result )

TableType = 3
TableName = "newtable2"
fields = "c,c,5;"

? 'Creating ADS table: "'+TableName+'" len='+Str(Len(TableName))
result = AdsCreateTable
(hConn,TableName,'',TableType,2,1,2,0,Fields,@hTable)
If result<>0
? 'It failed with result ' + STR(result )
ENDIF

AdsDisconnect( hConn )

"Adrian van der Merwe" <adrianv@taly.net> wrote in message
news:45b60575@solutions.advantagedatabase.com...
> Hi all,
>
> I am stumped by this and hoping for a little insight, or even a hint or
> suggestion. I have code that creates tables in a data dictionary and it
> works 100% when I am using the Database Server. However when using the
> local server, it creates the table, but the name inside the ADD is
> incorrect.
>