Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / December 2006



Tip: Looking for answers? Try searching our database.

DSN's

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lou - 18 Dec 2006 15:39 GMT
How do I show the same windows dialog for selecting a DSN as does windows in
ODBC Sources?
That would be the window titled
"ODBC Data sources administrator"

-Lou
Lance Wynn - 19 Dec 2006 01:10 GMT
I don't know if it's the same, but you can use the DataLink library, it
allows you to build oledb connection strings.

How do I show the same windows dialog for selecting a DSN as does windows in
ODBC Sources?
That would be the window titled
"ODBC Data sources administrator"

-Lou
Lou - 19 Dec 2006 16:20 GMT
Perfect, that worked great.
Thanks..

Found this simple code..

'John B
'VB Programmer
'zippity@leading.net

'******************
'YOU NEED:

'VB 6 with:
'Reference Setting checked - "Microsoft OLE DB Service Component
'1.0 Type Library"

'Reference Setting checked - "Microsoft ActiveX
'Data Objects 2.0 Library"

'******************
'http://www.freevbcode.com/ShowCode.Asp?ID=453
'STEPS:

'(1)Create EXE project

'(2)Place a long TextBox control named "txtconstr" on form
'[this is your ADO string]

'(3)Place a CommandButton called "cmdNew" on form

'(4)Place a second CommandButton called "cmdEdit" on form

'(5) Insert this code [new]

Private Sub cmdNew_Click()
On Error GoTo ERRORHANDLER
   Dim objDataLink As New DataLinks
   Dim strConn As String

   strConn = objDataLink.PromptNew
   txtconstr.Text = strConn

   Exit Sub
ERRORHANDLER:
   txtconstr.Text = ""
End Sub

'(6)Insert this code [edit]

Private Sub cmdEdit_Click()
On Error GoTo ERRORHANDLER
   Dim objDataLink As New DataLinks
   Dim ADOCN As New ADODB.Connection
   Dim strConn As String

   ADOCN.ConnectionString = txtconstr.Text
   strConn = objDataLink.PromptEdit(ADOCN)
   txtconstr.Text = ADOCN.ConnectionString

   Exit Sub
ERRORHANDLER:
    MsgBox "An invalid ADO ConnectionString was detected. Please try
again!"
    txtconstr.Text = ""
End Sub

>I don't know if it's the same, but you can use the DataLink library, it
> allows you to build oledb connection strings.
[quoted text clipped - 6 lines]
>
> -Lou
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.