Connection the ADP

R

Roy Goldhammer

Hello there
For short time ago i've created and adp

Now it says: Disconneted

How can i reconnect it again to the sql server?
 
B

BJ Freeman

Funny you should post this.
I have had an ADP that has been running flawlessly. I reloaded it today and
now I have no File->connection on the menu.

for your problem. is there a File->Connection on your menu.
is it filled in correctly?
Also are you using Pipes, and/or TCP/IP
 
B

BJ Freeman

you build a connect string and plug it into
currentproject.connnectinos.connectstring ="yourconnectstring"
if you know the server it is going to, you can hardcode this in the autoexec
or you can write some code that pulls the server that will be assigned from
the IP address of the computer that is running it.
this would be the equivalent of a small client server app. the client being
in the ADP and server being somewhere on your network.

Then you have a program that check the iP and send the correct server name
back to the ADP.

if you can do a
?currentproject.connnectinos.connectstring
you can see the properties
I also suggest you make it an ADE so someone can not do this and get the
password.
 
R

Roy Goldhammer

Well BJ

I didn't know about the File -> Connection when i post this message.
Afterword i found it and it still didn't work

The reason is that i detacth the database i work with to copy it to send on
email.
and forgot to attach it again to the server so when i attach it back it
worked fine again.

How ever. If we have already disscussed this

Is there way i can build a code that connect the ADP to sql server so when i
move my application to another computer with diffrent server name i can
still use it?
 
R

Roy Goldhammer

Well BJ

I tried the option you gave me on code but it don't work
It bring the error message: 3705- Operation is not allowed when the object
is open

Here is the code i used

Dim str As String
str = CurrentProject.Connection.ConnectionString
CurrentProject.Connection.Close
CurrentProject.Connection.ConnectionString = str

Can you help me on it?
 

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

Top