|
-
Jul 10th, 2006, 08:41 AM
#1
Thread Starter
Lively Member
[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.
-
Jul 10th, 2006, 09:51 AM
#2
Frenzied Member
Re: Clueless on Database
 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
-
Jul 10th, 2006, 10:04 AM
#3
Thread Starter
Lively Member
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!!!
-
Jul 10th, 2006, 10:14 AM
#4
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
-
Jul 10th, 2006, 08:42 PM
#5
Thread Starter
Lively Member
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.
-
Jul 11th, 2006, 01:42 AM
#6
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
-
Jul 11th, 2006, 01:46 AM
#7
Thread Starter
Lively Member
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.
-
Jul 11th, 2006, 01:57 AM
#8
Re: Clueless on Database
 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
-
Jul 11th, 2006, 02:36 AM
#9
Thread Starter
Lively Member
Re: Clueless on Database
Hi,
I got the database working.Hahaha...Thanks alot for your advice.
-
Jul 11th, 2006, 02:38 AM
#10
Re: Clueless on Database
 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
-
Jul 11th, 2006, 03:21 AM
#11
Thread Starter
Lively Member
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"
-
Jul 11th, 2006, 06:31 AM
#12
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|