?
Solved

VB linking to SQL db

Posted on 2003-03-19
8
Medium Priority
?
201 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

765 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