Results 1 to 12 of 12

Thread: [RESOLVED] Clueless on Database

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    100

    Resolved [RESOLVED] Clueless on Database

    Hi,

    I am using ADODB to connect to a MS Access 2003 database from my VB6 program.This is what i have to conect to my database:

    Set rdAccessconn = New ADODB.Connection '*** connect to db
    With rdAccessconn
    On Error GoTo ErrorHandler
    .ConnectionString = "dsn=phonebook"
    .Open
    .CursorLocation = adUseClient
    End With

    However,no matter how many chnages i've made to my database,it just wont change my VB output.Anyone help me with this?Thanks in advance.

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    Re: Clueless on Database

    Quote Originally Posted by K718
    Hi,

    I am using ADODB to connect to a MS Access 2003 database from my VB6 program.This is what i have to conect to my database:

    'This doesn't connect to any database. It creates a connection object
    Set rdAccessconn = New ADODB.Connection '*** connect to db
    With rdAccessconn
    On Error GoTo ErrorHandler 'this typically goes at the top of the sub

    'this isn't a valid connection string. Check www.connectionstrings.com
    .ConnectionString = "dsn=phonebook"
    .Open
    .CursorLocation = adUseClient
    End With

    However,no matter how many chnages i've made to my database,it just wont change my VB output.Anyone help me with this?Thanks in advance.
    I usually work in Access alone, using DAO, so use the comments above with that caveat.
    Tengo mas preguntas que contestas

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    100

    Re: Clueless on Database

    Hi,

    Regarding the link you gave me,i already loon into it before.But i have no idea how to apply to my codes.I suspect that the codes is a combination of SQL & Access.Cause i need to make enhancement to my program and the codes is written by someone else.But i have no idea to proceed as the database cant even work.So if u could recommend me any codes to use?Real Thanks!!!

  4. #4
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Clueless on Database

    What changes are you talking about. Do you make changes from VB Front-End itself. And if that is the case then you need to refresh the recordset first to reflect the changes.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    100

    Re: Clueless on Database

    Yes,I need to make changes to VB codes.But before that i need to understand what is wrong with the codes above.So i hope someone can point it out to me.Thanks alot.

  6. #6
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Clueless on Database

    There is nothing wrong with the codes that you have posted. Does the PHONEBOOK DSN exist in the system where you are testing your codes.

    Is there any other error message that you are getting.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    100

    Re: Clueless on Database

    Hi Shuja Ali,

    There aren't any error messages.Just that the changes make to the database is not updated to the VB.But,I've make some changes to my codes and gonna test it now.Thanks.

  8. #8
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Clueless on Database

    Quote Originally Posted by K718
    Hi Shuja Ali,

    There aren't any error messages.Just that the changes make to the database is not updated to the VB.But,I've make some changes to my codes and gonna test it now.Thanks.
    Check whether the PHONEBOOK DSN points to the same database in which you are making the changes.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    100

    Re: Clueless on Database

    Hi,

    I got the database working.Hahaha...Thanks alot for your advice.

  10. #10
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Clueless on Database

    Quote Originally Posted by K718
    Hi,

    I got the database working.Hahaha...Thanks alot for your advice.
    Do you mind sharing with us what was wrong? It might help others who hav the similar problem.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    100

    Re: Clueless on Database

    Sure,no problem.

    Initially i didn't state the file location of where i kept my database.I changed the code to this:

    rdAccessconn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Test\db1.mdb"

  12. #12
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    Re: [RESOLVED] Clueless on Database

    That's a better connection string.
    Tengo mas preguntas que contestas

Posting Permissions

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



Click Here to Expand Forum to Full Width