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.

Connection String

5 posts in DelphidotNet Last posting was on 2006-05-05 21:10:34.0Z
Benedictum Posted on 2006-05-03 13:39:45.0Z
From: "Benedictum" <nospam@dominusvobis.com>
Newsgroups: Advantage.DelphidotNet
Subject: Connection String
Date: Wed, 3 May 2006 08:39:45 -0500
Lines: 16
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 67.175.16.175
Message-ID: <4458b1d1@solutions.advantagedatabase.com>
X-Trace: 3 May 2006 07:36:17 -0700, 67.175.16.175
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!67.175.16.175
Xref: solutions.advantagedatabase.com Advantage.DelphidotNet:89
Article PK: 1108523

Here is what I want done:

I would like to have the web app access the connection string from the
web.config file. However, the web app will supply the user id and the
password during the login process before opening the database. The first
problem that I encountered is the inability of the web app to retrieve the
connection string. Can someone provide a code snippet on how to do it? I
really do not want to hard code the connection string.

fyi: Delphi2005Pro
servers: IIS5.1, Cassini, Apache.Net2.0.55
ASP Framework 1.1xx


Mark Wilkins Posted on 2006-05-03 14:36:22.0Z
From: "Mark Wilkins" <tired@of.spam>
Newsgroups: Advantage.DelphidotNet
References: <4458b1d1@solutions.advantagedatabase.com>
Subject: Re: Connection String
Date: Wed, 3 May 2006 08:36:22 -0600
Lines: 46
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
NNTP-Posting-Host: 198.102.102.13
Message-ID: <4458bf15@solutions.advantagedatabase.com>
X-Trace: 3 May 2006 08:32:53 -0700, 198.102.102.13
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!198.102.102.13
Xref: solutions.advantagedatabase.com Advantage.DelphidotNet:90
Article PK: 1108526

Hi,

I am using the following for a simple web app written with VS2005. I would
think the same would work in Delphi.NET.

In web.config, I have this:

<appSettings/>
<connectionStrings>
<add name="MyCS" connectionString="Data Source=c:\data\mydd.add;"
providerName="Advantage.Data.Provider" />
</connectionStrings>
<system.web>
...


I then retrieve the connection string with the following:
string connstr =
ConfigurationManager.ConnectionStrings["MyCS"].ConnectionString;
AdsConnection conn = new AdsConnection( connstr );


Mark Wilkins
Advantage R&D

"Benedictum" <nospam@dominusvobis.com> wrote in message
news:4458b1d1@solutions.advantagedatabase.com...
> Here is what I want done:
>
> I would like to have the web app access the connection string from the
> web.config file. However, the web app will supply the user id and the
> password during the login process before opening the database. The first
> problem that I encountered is the inability of the web app to retrieve the
> connection string. Can someone provide a code snippet on how to do it? I
> really do not want to hard code the connection string.
>
> fyi: Delphi2005Pro
> servers: IIS5.1, Cassini, Apache.Net2.0.55
> ASP Framework 1.1xx
>
>
>
>


Benedictum Posted on 2006-05-04 01:45:46.0Z
From: "Benedictum" <nospam@dominusvobis.com>
Newsgroups: Advantage.DelphidotNet
References: <4458b1d1@solutions.advantagedatabase.com> <4458bf15@solutions.advantagedatabase.com>
Subject: Re: Connection String
Date: Wed, 3 May 2006 20:45:46 -0500
Lines: 67
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
NNTP-Posting-Host: 67.175.16.175
Message-ID: <44595bfa@solutions.advantagedatabase.com>
X-Trace: 3 May 2006 19:42:18 -0700, 67.175.16.175
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!67.175.16.175
Xref: solutions.advantagedatabase.com Advantage.DelphidotNet:91
Article PK: 1108525

Thanks Mark. I had a similar approach using that in VS2005. Somehow it
doesn't work in Delphi. I am beginning to think that Delphi2005 has this
bug.

I also tried the following in the web config:

<appSettings>
<add key="myTestString" value="This is a test string" />
</appSettings>

in Delphi, in the page load method I retrieve the string with
MyString:=configuration.AppSettings['myTestString'].toString;

But nothing happened. Anything else I need to do? I will repost this also to
the Delphi NG and see if anyone is experiencing the same problem.

"Mark Wilkins" <tired@of.spam> wrote in message
news:4458bf15@solutions.advantagedatabase.com...
> Hi,
>
> I am using the following for a simple web app written with VS2005. I
> would think the same would work in Delphi.NET.
>
> In web.config, I have this:
>
> <appSettings/>
> <connectionStrings>
> <add name="MyCS" connectionString="Data Source=c:\data\mydd.add;"
> providerName="Advantage.Data.Provider" />
> </connectionStrings>
> <system.web>
> ...
>
>
> I then retrieve the connection string with the following:
> string connstr =
> ConfigurationManager.ConnectionStrings["MyCS"].ConnectionString;
> AdsConnection conn = new AdsConnection( connstr );
>
>
> Mark Wilkins
> Advantage R&D
>
>
> "Benedictum" <nospam@dominusvobis.com> wrote in message
> news:4458b1d1@solutions.advantagedatabase.com...
>> Here is what I want done:
>>
>> I would like to have the web app access the connection string from the
>> web.config file. However, the web app will supply the user id and the
>> password during the login process before opening the database. The first
>> problem that I encountered is the inability of the web app to retrieve
>> the connection string. Can someone provide a code snippet on how to do
>> it? I really do not want to hard code the connection string.
>>
>> fyi: Delphi2005Pro
>> servers: IIS5.1, Cassini, Apache.Net2.0.55
>> ASP Framework 1.1xx
>>
>>
>>
>>
>
>


Rados³aw Wójtowicz Posted on 2006-05-04 09:11:43.0Z
From: "Rados³aw Wójtowicz" <francja@elegancja>
Newsgroups: Advantage.DelphidotNet
References: <4458b1d1@solutions.advantagedatabase.com> <4458bf15@solutions.advantagedatabase.com> <44595bfa@solutions.advantagedatabase.com>
Subject: Re: Connection String
Date: Thu, 4 May 2006 11:11:43 +0200
Lines: 79
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 83.17.226.42
Message-ID: <4459c47e@solutions.advantagedatabase.com>
X-Trace: 4 May 2006 03:08:14 -0700, 83.17.226.42
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!83.17.226.42
Xref: solutions.advantagedatabase.com Advantage.DelphidotNet:93
Article PK: 1108527

MyString:=ConfigurationSettings.AppSettings.Get(''myTestString');

Works great for my (D2005)



U¿ytkownik "Benedictum" <nospam@dominusvobis.com> napisa³ w wiadomo¶ci
news:44595bfa@solutions.advantagedatabase.com...

> Thanks Mark. I had a similar approach using that in VS2005. Somehow it
> doesn't work in Delphi. I am beginning to think that Delphi2005 has this
> bug.
>
> I also tried the following in the web config:
>
> <appSettings>
> <add key="myTestString" value="This is a test string" />
> </appSettings>
>
> in Delphi, in the page load method I retrieve the string with
> MyString:=configuration.AppSettings['myTestString'].toString;

> But nothing happened. Anything else I need to do? I will repost this also
> to the Delphi NG and see if anyone is experiencing the same problem.
>
>
> "Mark Wilkins" <tired@of.spam> wrote in message
> news:4458bf15@solutions.advantagedatabase.com...
>> Hi,
>>
>> I am using the following for a simple web app written with VS2005. I
>> would think the same would work in Delphi.NET.
>>
>> In web.config, I have this:
>>
>> <appSettings/>
>> <connectionStrings>
>> <add name="MyCS" connectionString="Data Source=c:\data\mydd.add;"
>> providerName="Advantage.Data.Provider" />
>> </connectionStrings>
>> <system.web>
>> ...
>>
>>
>> I then retrieve the connection string with the following:
>> string connstr =
>> ConfigurationManager.ConnectionStrings["MyCS"].ConnectionString;
>> AdsConnection conn = new AdsConnection( connstr );
>>
>>
>> Mark Wilkins
>> Advantage R&D
>>
>>
>> "Benedictum" <nospam@dominusvobis.com> wrote in message
>> news:4458b1d1@solutions.advantagedatabase.com...
>>> Here is what I want done:
>>>
>>> I would like to have the web app access the connection string from the
>>> web.config file. However, the web app will supply the user id and the
>>> password during the login process before opening the database. The first
>>> problem that I encountered is the inability of the web app to retrieve
>>> the connection string. Can someone provide a code snippet on how to do
>>> it? I really do not want to hard code the connection string.
>>>
>>> fyi: Delphi2005Pro
>>> servers: IIS5.1, Cassini, Apache.Net2.0.55
>>> ASP Framework 1.1xx
>>>
>>>
>>>
>>>
>>
>>
>
>


Benedictum Posted on 2006-05-05 21:10:34.0Z
From: "Benedictum" <nospam@dominusvobis.com>
Newsgroups: Advantage.DelphidotNet
References: <4458b1d1@solutions.advantagedatabase.com> <4458bf15@solutions.advantagedatabase.com> <44595bfa@solutions.advantagedatabase.com> <4459c47e@solutions.advantagedatabase.com>
Subject: Re: Connection String
Date: Fri, 5 May 2006 16:10:34 -0500
Lines: 88
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 67.175.16.175
Message-ID: <445bbe7b@solutions.advantagedatabase.com>
X-Trace: 5 May 2006 15:07:07 -0700, 67.175.16.175
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!67.175.16.175
Xref: solutions.advantagedatabase.com Advantage.DelphidotNet:97
Article PK: 1108532

I managed to access the settings by using XMLTextReader. I know this is not
the right way but it is the only way I can access the settings. For now I
will stick with this. I may have to reinstall the D2005.
Thanks.

"Rados³aw Wójtowicz" <francja@elegancja> wrote in message
news:4459c47e@solutions.advantagedatabase.com...
> MyString:=ConfigurationSettings.AppSettings.Get(''myTestString');
>
> Works great for my (D2005)
>
>
>
> U¿ytkownik "Benedictum" <nospam@dominusvobis.com> napisa³ w wiadomo¶ci
> news:44595bfa@solutions.advantagedatabase.com...
>> Thanks Mark. I had a similar approach using that in VS2005. Somehow it
>> doesn't work in Delphi. I am beginning to think that Delphi2005 has this
>> bug.
>>
>> I also tried the following in the web config:
>>
>> <appSettings>
>> <add key="myTestString" value="This is a test string" />
>> </appSettings>
>>
>> in Delphi, in the page load method I retrieve the string with
>> MyString:=configuration.AppSettings['myTestString'].toString;
>
>
>
>> But nothing happened. Anything else I need to do? I will repost this also
>> to the Delphi NG and see if anyone is experiencing the same problem.
>>
>>
>> "Mark Wilkins" <tired@of.spam> wrote in message
>> news:4458bf15@solutions.advantagedatabase.com...
>>> Hi,
>>>
>>> I am using the following for a simple web app written with VS2005. I
>>> would think the same would work in Delphi.NET.
>>>
>>> In web.config, I have this:
>>>
>>> <appSettings/>
>>> <connectionStrings>
>>> <add name="MyCS" connectionString="Data Source=c:\data\mydd.add;"
>>> providerName="Advantage.Data.Provider" />
>>> </connectionStrings>
>>> <system.web>
>>> ...
>>>
>>>
>>> I then retrieve the connection string with the following:
>>> string connstr =
>>> ConfigurationManager.ConnectionStrings["MyCS"].ConnectionString;
>>> AdsConnection conn = new AdsConnection( connstr );
>>>
>>>
>>> Mark Wilkins
>>> Advantage R&D
>>>
>>>
>>> "Benedictum" <nospam@dominusvobis.com> wrote in message
>>> news:4458b1d1@solutions.advantagedatabase.com...
>>>> Here is what I want done:
>>>>
>>>> I would like to have the web app access the connection string from the
>>>> web.config file. However, the web app will supply the user id and the
>>>> password during the login process before opening the database. The
>>>> first problem that I encountered is the inability of the web app to
>>>> retrieve the connection string. Can someone provide a code snippet on
>>>> how to do it? I really do not want to hard code the connection string.
>>>>
>>>> fyi: Delphi2005Pro
>>>> servers: IIS5.1, Cassini, Apache.Net2.0.55
>>>> ASP Framework 1.1xx
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>