Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Sybase > ODBC connection string

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-13-07, 00:26
jazzz jazzz is offline
Registered User
 
Join Date: Nov 2007
Posts: 1
ODBC connection string

can anyone help me out how to write the connection string ODBC. I want to connect sybase database to excel. Please help me im new to this.
Reply With Quote
  #2 (permalink)  
Old 11-13-07, 04:34
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 830
Just create an ODBC data source and use that from excel
You looking for something like this?
Code:
Sub Macro1() ' ' Macro1 Macro ' Macro recorded 13/11/2007 by PDreyer ' ' With ActiveSheet.QueryTables.Add(Connection:= _ "ODBC;DRIVER={Sybase ASE ODBC Driver};NA=host1,4100;DB=master;UID=PDreyer;" _ , Destination:=Range("A1")) .CommandText = Array( _ "SELECT sysdatabases.name" & Chr(13) & "" & Chr(10) & "FROM master.dbo.sysdatabases sysdatabases") .Name = "Query from srv1" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .PreserveColumnInfo = True .Refresh BackgroundQuery:=False End With End Sub
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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