PC Review


Reply
Thread Tools Rate Thread

Does connection string need anything on system?

 
 
gerryR
Guest
Posts: n/a
 
      14th Sep 2009
I'm setting up a connection string to an excel file which will be stored in
the same location as the asp.net page (wwwroot)

Do I need to setup something on the system's Data Source Tool
(Administrative Tools-->Data Sources (ODBC)) to corrospond with that
connection string? If so what are the settings? (eg does it have to have
the exact same name as the connection string, or how do the two relate)

Thanks for any help, fairly new to all this!
gR

 
Reply With Quote
 
 
 
 
gerryR
Guest
Posts: n/a
 
      14th Sep 2009
Hi,

We're using older .xls files, will the method mentioned there support that?

Also, is a Data Source required to be setup on the client if using an ODBC
connection? Even if I don't go down that route I'd like to know, I'm
curious as to what the Data Source tool is used for.

Thanks
gR



"Mark Rae [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "gerryR" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> I'm setting up a connection string to an Excel file which will be stored
>> in the same location as the asp.net page (wwwroot)
>>
>> Do I need to setup something on the system's Data Source Tool
>> (Administrative Tools-->Data Sources (ODBC)) to correspond with that
>> connection string?

>
> Forget ODBC...
>
>> Thanks for any help, fairly new to all this!

>
> http://www.connectionstrings.com/excel-2007
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net


 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      14th Sep 2009
You would only need to set up a Data Source Name (DSN) using the ODBC
Manager if you plan to use ODBC to connect to Excel. If you want to use a
DSN-less connection (where the provider is on the system already and you
just configure your connection string to use it), then setting up the
connection string will suffice.

-Scott


"gerryR" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm setting up a connection string to an excel file which will be stored
> in the same location as the asp.net page (wwwroot)
>
> Do I need to setup something on the system's Data Source Tool
> (Administrative Tools-->Data Sources (ODBC)) to corrospond with that
> connection string? If so what are the settings? (eg does it have to have
> the exact same name as the connection string, or how do the two relate)
>
> Thanks for any help, fairly new to all this!
> gR



 
Reply With Quote
 
gerryR
Guest
Posts: n/a
 
      14th Sep 2009
How do you know what providers are all ready on the system?

Thanks
gR



"Scott M." <s-(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> You would only need to set up a Data Source Name (DSN) using the ODBC
> Manager if you plan to use ODBC to connect to Excel. If you want to use a
> DSN-less connection (where the provider is on the system already and you
> just configure your connection string to use it), then setting up the
> connection string will suffice.
>
> -Scott
>
>
> "gerryR" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> I'm setting up a connection string to an excel file which will be stored
>> in the same location as the asp.net page (wwwroot)
>>
>> Do I need to setup something on the system's Data Source Tool
>> (Administrative Tools-->Data Sources (ODBC)) to corrospond with that
>> connection string? If so what are the settings? (eg does it have to
>> have the exact same name as the connection string, or how do the two
>> relate)
>>
>> Thanks for any help, fairly new to all this!
>> gR

>
>

 
Reply With Quote
 
Gregory A. Beamer
Guest
Posts: n/a
 
      14th Sep 2009
"gerryR" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> I'm setting up a connection string to an excel file which will be
> stored in the same location as the asp.net page (wwwroot)
>
> Do I need to setup something on the system's Data Source Tool
> (Administrative Tools-->Data Sources (ODBC)) to corrospond with that
> connection string? If so what are the settings? (eg does it have to
> have the exact same name as the connection string, or how do the two
> relate)
>


NO.

But you will most likely have to get the actual path to the file or use a
UNC to use it as a data source (not tested, but sound theory).

Peace and Grace,


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

My vacation and childhood cancer awareness site:
http://www.crazycancertour.com

*******************************************
| Think outside the box! |
*******************************************
 
Reply With Quote
 
Gregory A. Beamer
Guest
Posts: n/a
 
      14th Sep 2009
"gerryR" <(E-Mail Removed)> wrote in
news:#(E-Mail Removed):

> How do you know what providers are all ready on the system?


Run it and see if it breaks. ;-)

With .NET OLEDB, you will need the Jet drivers, which are not included with
the main install in most versions of .NET. You can download them from
Microsoft. Actually, the advice of putting the files out and seeing if they
break is valid, as it is the quickest way on a new web app install to see
if you need to install anything.

I would not use ODBC for Excel unless you absolutely have to, as it will be
slower for no reason.

Peace and Grace,

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

My vacation and childhood cancer awareness site:
http://www.crazycancertour.com

*******************************************
| Think outside the box! |
*******************************************
 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      14th Sep 2009
Open DataBase Connectivity (ODBC) is a Microsoft standard (albeit an old
one) that allowed a developer to set up a Data Source Name (DSN) within the
operating system. This DSN needed to be configured to know which database
driver was going to be needed and which actual data source was being used.
This is what the ODBC Manager tool in Control Panel > Admin Tools is
for...setting up a DSN. The DSN must then be set up on EACH machine where
the DSN would be called from executing code.

OLEDB Providers (a.k.a. DSN-less connections) superceded ODBC some time ago
and allow for you to take the middle man (the ODBC Mananger) and the
machine-specific DSN's created by it out of the picture. With OLEDB, you
code directly against the provider and, as long as the provider is present
on the target machine, the code can talk to it. This results in better
performance and is why OLEDB is preferred to ODBC.

Greg's advice to try it and see if it breaks (or the optimist's view: try it
and see if it works) is probably the easiest way to know if you have the
needed provider in an application that will run from a server (since you
don't want to be running around and checking every user's machine to see if
it breaks/works. If it works on your server (where the app is running),
you're all set! If not, you can contact the data source vendor (in this
case Microsoft) to obtain the necessary provider. Microsoft's various OS's
do come from the factory with many providers baked right it, but JET (which
is uesed in older MS products) is no longer a standard part of the MDAC
(Microsoft Data Access Controls) download. However, it can be found as a
standalone download from various sources.

-Scott


"gerryR" <(E-Mail Removed)> wrote in message
news:O6q8$(E-Mail Removed)...
> Hi,
>
> We're using older .xls files, will the method mentioned there support
> that?
>
> Also, is a Data Source required to be setup on the client if using an ODBC
> connection? Even if I don't go down that route I'd like to know, I'm
> curious as to what the Data Source tool is used for.
>
> Thanks
> gR
>
>
>
> "Mark Rae [MVP]" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> "gerryR" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>
>>> I'm setting up a connection string to an Excel file which will be stored
>>> in the same location as the asp.net page (wwwroot)
>>>
>>> Do I need to setup something on the system's Data Source Tool
>>> (Administrative Tools-->Data Sources (ODBC)) to correspond with that
>>> connection string?

>>
>> Forget ODBC...
>>
>>> Thanks for any help, fairly new to all this!

>>
>> http://www.connectionstrings.com/excel-2007
>>
>>
>> --
>> Mark Rae
>> ASP.NET MVP
>> http://www.markrae.net

>



 
Reply With Quote
 
gerryR
Guest
Posts: n/a
 
      15th Sep 2009
Thanks for the detailed explanation Scott.

Moving away from ODBC now.

"Scott M." <s-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Open DataBase Connectivity (ODBC) is a Microsoft standard (albeit an old
> one) that allowed a developer to set up a Data Source Name (DSN) within
> the operating system. This DSN needed to be configured to know which
> database driver was going to be needed and which actual data source was
> being used. This is what the ODBC Manager tool in Control Panel > Admin
> Tools is for...setting up a DSN. The DSN must then be set up on EACH
> machine where the DSN would be called from executing code.
>
> OLEDB Providers (a.k.a. DSN-less connections) superceded ODBC some time
> ago and allow for you to take the middle man (the ODBC Mananger) and the
> machine-specific DSN's created by it out of the picture. With OLEDB, you
> code directly against the provider and, as long as the provider is present
> on the target machine, the code can talk to it. This results in better
> performance and is why OLEDB is preferred to ODBC.
>
> Greg's advice to try it and see if it breaks (or the optimist's view: try
> it and see if it works) is probably the easiest way to know if you have
> the needed provider in an application that will run from a server (since
> you don't want to be running around and checking every user's machine to
> see if it breaks/works. If it works on your server (where the app is
> running), you're all set! If not, you can contact the data source vendor
> (in this case Microsoft) to obtain the necessary provider. Microsoft's
> various OS's do come from the factory with many providers baked right it,
> but JET (which is uesed in older MS products) is no longer a standard part
> of the MDAC (Microsoft Data Access Controls) download. However, it can be
> found as a standalone download from various sources.
>
> -Scott
>
>
> "gerryR" <(E-Mail Removed)> wrote in message
> news:O6q8$(E-Mail Removed)...
>> Hi,
>>
>> We're using older .xls files, will the method mentioned there support
>> that?
>>
>> Also, is a Data Source required to be setup on the client if using an
>> ODBC connection? Even if I don't go down that route I'd like to know,
>> I'm curious as to what the Data Source tool is used for.
>>
>> Thanks
>> gR
>>
>>
>>
>> "Mark Rae [MVP]" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> "gerryR" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>
>>>> I'm setting up a connection string to an Excel file which will be
>>>> stored in the same location as the asp.net page (wwwroot)
>>>>
>>>> Do I need to setup something on the system's Data Source Tool
>>>> (Administrative Tools-->Data Sources (ODBC)) to correspond with that
>>>> connection string?
>>>
>>> Forget ODBC...
>>>
>>>> Thanks for any help, fairly new to all this!
>>>
>>> http://www.connectionstrings.com/excel-2007
>>>
>>>
>>> --
>>> Mark Rae
>>> ASP.NET MVP
>>> http://www.markrae.net

>>

>
>

 
Reply With Quote
 
gerryR
Guest
Posts: n/a
 
      15th Sep 2009


"Gregory A. Beamer" <(E-Mail Removed)> wrote in message
news:Xns9C867E4BD5C10gbworld@207.46.248.16...
> "gerryR" <(E-Mail Removed)> wrote in
> news:#(E-Mail Removed):
>
>> How do you know what providers are all ready on the system?

>
> Run it and see if it breaks. ;-)
>


I'll give it a go so, only problem with this method is I'm new to this so if
it doesn't work it's could be down to something else I've done

Thanks
gR



 
Reply With Quote
 
gerryR
Guest
Posts: n/a
 
      15th Sep 2009
"Mark Rae [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "gerryR" <(E-Mail Removed)> wrote in message
> news:O6q8$(E-Mail Removed)...


>> will the method mentioned there support that?

>
> http://www.connectionstrings.com/excel
>
>
>> Also, is a Data Source required to be setup on the client if using an
>> ODBC connection?

>
> No. Once again, there is no reason to use ODBC when OleDb is available...
>
>

Thanks, I'll have a go with that connection string.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'System.String[]' from its string representation 'String[] Array' =?Utf-8?B?UmFqZXNoIHNvbmk=?= Microsoft ASP .NET 0 4th May 2006 05:29 PM
Connection String question - accessing one string throughout solut =?Utf-8?B?Z2FyeSBnLg==?= Microsoft Dot NET 2 26th Apr 2006 06:48 PM
Connection String object Convert to String Variable Type =?Utf-8?B?TWlrZSBNb29yZQ==?= Microsoft ASP .NET 2 26th Oct 2004 03:43 PM
connection string exception : Format of the initialization string does not conform to specification starting at index 0 Gaurav Microsoft ASP .NET 0 7th Nov 2003 10:24 AM
Cannot create an object of type 'System.String[]' from its string representation 'String[] Array' for the 'Options' property. Hessam Microsoft C# .NET 0 8th Aug 2003 09:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:55 PM.