Make DB move with EXE

  • Thread starter Thread starter Barkster
  • Start date Start date
B

Barkster

I don't usually create installers for my projects cause we have dotnet on
all our machines and I normally just copy the exe and any required Dll's to
the folder where I want to run. Normally I just stick
application.startuppath to create dynamic paths but I can't seem to get this
to work on my Oleconnection. If I change it in the form designer generated
code to my application.startuppath etc.. it renames it on rebuild and if I
try and set it on load by setting oleconnection1.connectionstring it doesn't
seem to work either. Is there a way to make this load from the
startuppath\data\ folder?

Thanks
 
Barkster,

I have strugled a longtime with this and it is so easy, just set in the load
event from your form (or whatever place, before the connection object is
used however after that it is initialized) using the connection object you
have created with the designer (and don't change that in the designer
generated code) the connection string.

Someting as
OleDBConnection1.connectionstring = "xxxxxxxxxxxxx" & applicationstartuppath

Mostly those connection strings do not have that difficult as build with the
designer, have a look at these links for them.

http://www.connectionstrings.com/

http://www.able-consulting.com/ADO_Conn.htm

I hope this helps?

Cor
 
Thanks Cor, I think I've got it working now.

Cor Ligthert said:
Barkster,

I have strugled a longtime with this and it is so easy, just set in the load
event from your form (or whatever place, before the connection object is
used however after that it is initialized) using the connection object you
have created with the designer (and don't change that in the designer
generated code) the connection string.

Someting as
OleDBConnection1.connectionstring = "xxxxxxxxxxxxx" & applicationstartuppath

Mostly those connection strings do not have that difficult as build with the
designer, have a look at these links for them.

http://www.connectionstrings.com/

http://www.able-consulting.com/ADO_Conn.htm

I hope this helps?

Cor
 

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

Back
Top