Web application problems

G

Guest

I am trying to create a web application using VB.NET. I will be deploying
multiple instances of this application on the same server, each with it's own
Access database. Unfortunately, every example I've seen shows how to access
data using ODBC at design time. This won't work for me. I would have to have
a different code base for each instance. What I need is a way for the entire
application to know what ODBC source it is supposed to use, and I need to be
able to assign this at runtime. This must be fairly common, right? Can
someone help me figure out where to look for a solution here?
 
G

Guest

I'm using Visual Studio .NET 2003...is there an easy way to tell what version
of ASP that implies?
 
M

Marina Levit [MVP]

You are using 1.1.

I would ignore any sample that uses the design time environment to create
database connections. etc. There should be plenty of samples that show you
how to do this in code yourself.

A common place to put connection information is in Web.config of the web
application. Each deployment would have a different value there with regards
to which database to connect to.
 
G

Guest

So you're saying I have to do all of my data connections in code, as opposed
to using any of the wizards or designers? I was trying to avoid that. MS
seems to have put a lot of trouble into building those tools...are they
really that limited? This is a fairly simple application, and I'm not doing
anything special here. Development time is a major concern.
 
J

JT

If you're putting multiple instances of the application on the same
server, will they have different project names? Different folders? If
so, and you're going to have multiple databases, just put them in the
same folder relative to the web applicaiton. Then your connection
string could be relative (and the same).
 
G

Guest

I guess I could do that, though I was hoping to use ODBC data sources instead
of hardcoding the database name. Thanks, good idea. Although, when I run the
program, the "current directory" seems to be my windows directory, so the
file isn't found.
 
G

Guest

this sounds like the way to go. I can't find any examples of this, either how
to put the connection into the web.config, or how to access it from my pages
later. Can you point me to an example?
 
J

JT

Hey Geoffrey,

I'm not real happy about the way this site notifies you (or doesn't
notify you) of activity. I just now realized you posted again. If you
haven't gotten it working, tell me where you're hung up and I'll try to
help. I haven't tried using a relative path in the web.config file, so
I don't know if that would work, but if you make your connection in
code, you can use the MapPath() method to get the full path from your
relative specification.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top