473,511 Members | 15,178 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

data source

I went to save an access db in the bin folder so I do not have to hard code
it like this:
string sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=E:\\\\Freddy\\Projects\\vb.net\\Project Track It\\bin\\Project.mdb";
Nov 17 '05 #1
3 2667
Hi Freddy,

I assume it is an ASP .NET app, where you can probably use Server.MapPath to
obtain the physical path of the virtual folder where your ASP .NET
application resides:

string sConnString =
string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Da taSource={0}\\bin\\Project.mdb",
Server.MapPath("/MyWebApp");

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"freddy" <fr****@discussions.microsoft.com> wrote in message
news:C7**********************************@microsof t.com...
I went to save an access db in the bin folder so I do not have to hard code
it like this:
string sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=E:\\\\Freddy\\Projects\\vb.net\\Project Track
It\\bin\\Project.mdb";


Nov 17 '05 #2
this is for a winform

"Dmytro Lapshyn [MVP]" wrote:
Hi Freddy,

I assume it is an ASP .NET app, where you can probably use Server.MapPath to
obtain the physical path of the virtual folder where your ASP .NET
application resides:

string sConnString =
string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Da taSource={0}\\bin\\Project.mdb",
Server.MapPath("/MyWebApp");

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"freddy" <fr****@discussions.microsoft.com> wrote in message
news:C7**********************************@microsof t.com...
I went to save an access db in the bin folder so I do not have to hard code
it like this:
string sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=E:\\\\Freddy\\Projects\\vb.net\\Project Track
It\\bin\\Project.mdb";


Nov 17 '05 #3
Then, use Application.StartupPath instead of Server.MapPath.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"freddy" <fr****@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
this is for a winform

"Dmytro Lapshyn [MVP]" wrote:
Hi Freddy,

I assume it is an ASP .NET app, where you can probably use Server.MapPath
to
obtain the physical path of the virtual folder where your ASP .NET
application resides:

string sConnString =
string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Da taSource={0}\\bin\\Project.mdb",
Server.MapPath("/MyWebApp");

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"freddy" <fr****@discussions.microsoft.com> wrote in message
news:C7**********************************@microsof t.com...
>I went to save an access db in the bin folder so I do not have to hard
>code
> it like this:
> string sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=E:\\\\Freddy\\Projects\\vb.net\\Project Track
> It\\bin\\Project.mdb";



Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3652
by: Monica Ferrero | last post by:
Hi! I'm not sure if this is the most adequate mySQL list for this post. If not, please indicat me which one I should use... I'm using Tomcat 4.1.24 with Apache 2 and MySQL 4.0.13. I have the...
2
2447
by: Greg Strong | last post by:
Hello All, I've written code in a test database with test data. Everything seems to be working except compact database in VB code per http://www.mvps.org/access/general/gen0041.htm. The reason I...
18
1566
by: xarax | last post by:
Greetings, What is the general practice, usual and customary way, of including a data file into a source file? I have some large data structures defined as source similar to: ...
5
2757
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
5
2864
by: rogsonl | last post by:
My computer was moved last week, and the company changed the network groups we work on. As a result, one of the main benefits from Whidbey (database connectivity) no longer works. Situation: 1....
14
14602
by: Rolf Welskes | last post by:
Hello, I have an ObjectDataSource which has as business-object a simple array of strings. No problem. I have an own (custom) control to which I give the DataSourceId and in the custom-control...
7
10039
by: John J. Hughes II | last post by:
I have a DataGridView with a TextBoxColumn. I setting the data source to a List<stringvalue in a static class. The list is filled from a background thread. So far all is fine and it works...
9
3993
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New...
0
3107
by: BillE | last post by:
I am using Visual Studio 2005 to create a web site which includes reports. The web site has several sub-folders. When working with reports I can't get the website data sources (classes and...
0
1879
natalie99
by: natalie99 | last post by:
Hey people! Being so lacking in access knowhow I have turned to good old 'asking the smart people' again! I need to create a query or lookup table (although I have had zero success with lookups...
0
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7349
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3219
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
445
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.