?
Solved

VB linking to SQL db

Posted on 2003-03-19
8
Medium Priority
?
211 Views
Last Modified: 2012-05-04
I have an IP address to an SQL db and all the correct details, i can prove this by setting up a system dsn and all is well.

Quesiton:  i need to distribute this app to 150 people and therefore need to get the connection setup either as a system dsn or as a clever work around.  The SQL server is only addressable as an IP address not by name.  If as a DSN how do i include this as part of the distribution package?

thanks

john
0
Comment
Question by:johnmaserati
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8168094
You could include any file with P&D Wizard.
0
 
LVL 9

Expert Comment

by:dancebert
ID: 8168174
I think I have a solution if the answer to both the following questions is true.

Is the IP address of the server part of the connection string?

Do both workstation and server operating sytsems support Com+?  (I think that's XP and 2000, but I'm not sure)
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 8168231
i don't know how did you set your DSN, but if you need to translate ip address to host name, it could be done.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 2

Accepted Solution

by:
selim007 earned 375 total points
ID: 8168334
dear,
you can connect to the SQL server without creating a DSN.
assuming that we are using Microsoft activeX dataobject.
here's the code:

dim strConnectionString as string
dim CnXn as new connection
strConnectionString = "Driver={SQL Server};Server=servername;UID=username;PWD=password;Database=database_name;"
CnXn.Open strConnectionString
CnXn.CursorLocation = adUseClient

replace servername,username,password and database_name
with your own values.
good luck
0
 
LVL 2

Expert Comment

by:selim007
ID: 8168337
P.S. the server name can be an IP address
0
 
LVL 9

Expert Comment

by:dancebert
ID: 8168428
I think I have a solution if the answer to both the following questions is true.

Is the IP address of the server part of the connection string?

Do both workstation and server operating sytsems support Com+?  (I think that's XP and 2000, but I'm not sure)
0
 

Author Comment

by:johnmaserati
ID: 8170613
Sorry i should have made one thing clear.

I am using the data link which is part of the VB ide.  The data link doesn't appear to allow me to dig around and manually set the connection string (could be wrong) so i can't use
****
strConnectionString = "Driver={SQL Server};Server=servername;UID=username;PWD=password;Database=database_name;"

I did this with the last VB project but i wasn't using the built in data controls the dsr etc..

Adding a file, what file?  does the P&D process capture the details of my DSN and add that to the package?

Com: I don't know and probably won't get a reliable answer as to whether the server will be running COM.


i maybe being obtuse here or having brain fade
0
 

Author Comment

by:johnmaserati
ID: 8297990
thanks,

you're right.  pity i can't use this with the datalink in vb, or is the datalink to be avoided?

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question