PC Review


Reply
Thread Tools Rate Thread

How to connect MS SQL Server using VBA Macro Programming?

 
 
=?Utf-8?B?UmFqdSBB?=
Guest
Posts: n/a
 
      26th Oct 2007
Hi,

Can you pls send me the connection string of connecting MS SQL Server using
VBA Programming...

Reply me asap..

Regards
Raj
 
Reply With Quote
 
 
 
 
=?Utf-8?B?U2VhbkMgVUs=?=
Guest
Posts: n/a
 
      26th Oct 2007
Hi Raj,

The exact details will depend on the server name, user name and password etc.

Here is a way to get most of the information you need.

Open Windows Explorer and in some directory right click and choose
New>>Text Document.

Then change the file extension of that document from .txt to .udl This
changes the file type to a data link file.

Double click the file and the Data Link properties dialogue will appear.
Select the required Provider on the first tab and click Next. Fill in the
required information on the Connection tab (Server, User Name etc). Test the
connection to make sure you have the details correct. Once you have then
click OK.

The above step requires the oledb32.dll (or similar) to be on your system,
and it should be by default.

Now right click the file and select Open With and choose Notepad. Now you
will see the udl file in notepad, and that will have your specific connection
string. Once you have the basics of this in your code you can play around
with it so that you can ask the user for their User Name and Password etc.

Hope this helps,

Sean.
--
(please remember to click yes if replies you receive are helpful to you)


"Raju A" wrote:

> Hi,
>
> Can you pls send me the connection string of connecting MS SQL Server using
> VBA Programming...
>
> Reply me asap..
>
> Regards
> Raj

 
Reply With Quote
 
=?Utf-8?B?UmFqdSBB?=
Guest
Posts: n/a
 
      27th Oct 2007
hi sean,

Thanks a lot for ur immediate reply.

can i have ur mail id.
mine is (E-Mail Removed)

Raj

"SeanC UK" wrote:

> Hi Raj,
>
> The exact details will depend on the server name, user name and password etc.
>
> Here is a way to get most of the information you need.
>
> Open Windows Explorer and in some directory right click and choose
> New>>Text Document.
>
> Then change the file extension of that document from .txt to .udl This
> changes the file type to a data link file.
>
> Double click the file and the Data Link properties dialogue will appear.
> Select the required Provider on the first tab and click Next. Fill in the
> required information on the Connection tab (Server, User Name etc). Test the
> connection to make sure you have the details correct. Once you have then
> click OK.
>
> The above step requires the oledb32.dll (or similar) to be on your system,
> and it should be by default.
>
> Now right click the file and select Open With and choose Notepad. Now you
> will see the udl file in notepad, and that will have your specific connection
> string. Once you have the basics of this in your code you can play around
> with it so that you can ask the user for their User Name and Password etc.
>
> Hope this helps,
>
> Sean.
> --
> (please remember to click yes if replies you receive are helpful to you)
>
>
> "Raju A" wrote:
>
> > Hi,
> >
> > Can you pls send me the connection string of connecting MS SQL Server using
> > VBA Programming...
> >
> > Reply me asap..
> >
> > Regards
> > Raj

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect SQL server via USB give "Server does not exist or access denied" after few succeful connect. but always work wireless Vincent Microsoft Dot NET Compact Framework 4 5th Sep 2006 01:51 AM
How to connect Access DB via VC++ programming? mandar2019@gmail.com Microsoft Access Forms 1 3rd May 2006 01:44 PM
How do i change this connect string to support a SQL Server 2000 running on port 8832 User ID=car;Password=rat;Server=abc.def.hij;Initial Catalog=foobar i tried Server=abc.def.hij:8823 and Server=abc.def.hij;port=8823 neither of these work Daniel Microsoft Dot NET Framework 1 16th Dec 2004 09:55 PM
Macro programming =?Utf-8?B?S3Jpc3Rpbg==?= Microsoft Excel Programming 1 27th Sep 2004 06:27 PM
Can't connect to Internet thru router - can't connect to DHCP server. Madison Lapierre Windows XP General 0 14th Mar 2004 10:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:02 AM.