|
-
Nov 11th, 2001, 05:19 PM
#1
Thread Starter
Junior Member
ADODC Connection
I tried putting two ADODC controls on my form, which both connect to the same database. One connects to one table in the database, while the other connects to a different table. For some reason, only ADODC1 is working. When I run the program, ADODC2 is disable and will not work. Does anyone know what is causing this problem? Thanks.
-B4
-
Nov 11th, 2001, 07:48 PM
#2
PowerPoster
Make sure it's not opening the database exclsuively.
And look at how it's connecting to the db any recordset locks?
A better solution would not to use the datacontrol at all but just use adodb!
-
Nov 11th, 2001, 08:53 PM
#3
Thread Starter
Junior Member
The ADODC control does not have an Exclusive property, and I am not familiar with ADODB, could you provide me with any more information you have? Thanks in advance.
-
Nov 12th, 2001, 12:53 AM
#4
PowerPoster
Ok you can use karls tutorial on vb-world for adodb to learn or use my images in databases that uses it too.
But in adodc, this is off the top of my head, there should be something like adolockpessimistic, or adolockoptimistic in where you specify you connection!
Or look at things like move forward only.
Gimme 20 mins i'll have a look for you!
b
-
Nov 12th, 2001, 01:20 AM
#5
PowerPoster
Ok:
Check stuff like:
Mode Property: Should be ShareDenyNone
Lock Type: Should be Optimistic
In Custom/Build and the advanced tab should have sharedenynone
Hows that?
b
-
Nov 12th, 2001, 01:22 AM
#6
Frenzied Member
i think there should be a international law against using adodc
-
Nov 12th, 2001, 01:29 AM
#7
Thread Starter
Junior Member
What is the best method to use? I am trying to connect to an Access database, and then link the textboxes in my form to the fields from the database. I am not sure how to do with without using ADODC.
-
Nov 12th, 2001, 03:14 AM
#8
Frenzied Member
first you need to learn a little bit about ADO
you need a connection object
then you a recordset object
then you send in a sql statement to retrieve the data
pretty simple
i could give you the code
but you should learn it
start with learning what ADO is and how to use it
-
Nov 12th, 2001, 11:04 AM
#9
Thread Starter
Junior Member
I would be interested in learning more about ADO. Could you please point me to some places which provide good tutorials or information so that I can get a better understanding? Thanks.
-
Nov 12th, 2001, 11:07 AM
#10
Frenzied Member
-
Nov 12th, 2001, 11:12 AM
#11
Thread Starter
Junior Member
-
Nov 12th, 2001, 12:52 PM
#12
Addicted Member
You can set the properties of those 2 ADODC at design or you can code them at Form_Load.
I have 2 ADODC in my App and I use the following code and have no problem with that.
Private Sub Form_Load()
With Adodc1
.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.3.51;" & _
"Persist Security Info=False;Data Source=" & _
App.Path & "\db1.mdb;Mode=ReadWrite"
.CommandType = adCmdTable
'set Table name
.RecordSource = "Table1"
.Refresh
End With
With Adodc1
.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.3.51;" & _
"Persist Security Info=False;Data Source=" & _
App.Path & "\db1.mdb;Mode=ReadWrite"
.CommandType = adCmdTable
'set Table name
.RecordSource = "Table2"
.Refresh
End With
End Sub
Replace 3.51 by 4.0 if you are using MS Access 2000
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
|