+ Reply to Thread
Results 1 to 2 of 2

Need to connect Database.

  1. #1
    Forum Contributor
    Join Date
    08-15-2016
    Location
    Chennai
    MS-Off Ver
    MS2013
    Posts
    159

    Need to connect Database.

    hi,

    I am using below code to connect DB2, and getting an error message called " SQL1024N A database connection does not exist.SQLSTATE = 08003".

    Please help me to resolve this.


    Private Sub CommandButton1_Click()

    Set conn = CreateObject("adodb.connection")
    Set rs = CreateObject("adodb.recordset")
    'Set cmdobj=createobject("adodb.command")

    conn.Open "Driver={IBM DB2 ODBC DRIVER};""Server=djaxludb1009.corp.citistreet.org:62932/SSOIN01;""Uid=****;""Pwd=****"
    If conn.State = "1" Then 'Check connection
    MsgBox " Pass"
    End If

    End Sub

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,851

    Re: Need to connect Database.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Connect to Database
    By rlee12 in forum Access Tables & Databases
    Replies: 3
    Last Post: 08-29-2015, 12:10 AM
  2. Connect database
    By esreveR in forum Excel General
    Replies: 13
    Last Post: 01-25-2011, 06:44 AM
  3. Macro to connect database
    By ashish508 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-26-2010, 05:48 AM
  4. Connect to MS SQL 2005 Database
    By proZero in forum Access Tables & Databases
    Replies: 4
    Last Post: 12-09-2009, 04:21 AM
  5. Cannot connect to Access database
    By estronutz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2007, 12:42 AM
  6. [SOLVED] connect a form to excel database
    By Kathy in forum Excel General
    Replies: 5
    Last Post: 10-10-2005, 02:05 AM
  7. cannot connect to .mdf database
    By midavis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-23-2005, 08:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1