-
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
-
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!
-
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.
-
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 :)
-
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 :)
-
i think there should be a international law against using adodc
:)
-
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.
-
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
-
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.
-
-
-
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