|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Halloo everbody,
This is Kiran Karnati an Indian student from Germany.First time registered to a forum and posting a problem. For my company I have developed an MS Access application, now my boss asked me to do this application in a multi user environemnt. They want a central Access databse file in a shared folder and a database in every user system. I have splitted my Access database and put the backend in tha shared folder but it is working from only one system at one time. if the user who opend the front end of his system first , must close before the other user can open the application. my forms are bound forms , may be this is the reason that they are not working, but I have tried to connect to the databse through ADO connection object but it is working from 1 system not any other systems. can any one please reply me in connecting to a remote databse that is in a shared folder and give some idea how to show data onto form when it is unbound. I have tried a method which is working from only one system, I don't know why? that is : Public Function uf_DisplayRecord(frm As Form, intRecord As Integer) As Integer 'Displays the record determined by intRecord 'returns the number of records in the recordset Dim strConnection As String Dim cnn As New ADODB.Connection Dim rst As New ADODB.Recordset Dim fld As ADODB.Field Dim ctl As Control Dim vartemp As Variant Dim strCnn, strCtlname As String Dim strQryUser As String Dim ctlCount, ctlloop As Integer Set cnn = CreateObject("ADODB.Connection") strCnn = "Driver={Microsoft Access Driver (*.mdb)};" & _ "Dbq=\\D-server\persönlicher ordner\CABANNA_be.mdb;" cnn.Open strCnn strQryUser = "SELECT * FROM User" Set rst = cnn.Execute(strQryUser) rst.Move intRecord - 1 ctlCount = frm.Controls.Count strCtlname = frm.Controls(1).Name ' Set frm.lbl.Caption = strCtlname 'Iterate through controls on form that match fields in recordset For ctlloop = 0 To ctlCount 'if error the field is not on the form On Error Resume Next ' Err = 0 strCtlname = frm.Controls(ctlloop).Name vartemp = rst.Fields(strCtlname).Name ' If Err = 0 Then ' On Error GoTo ErrorHandler 'if control enables then set deafault value from tag and set focus if tab index 0 If frm.Controls(ctlloop).Enabled Then frm.Controls(ctlloop).Value = rst.Fields(strCtlname).Value If frm.Controls(ctlloop).TabIndex = 0 Then frm.Controls(ctlloop).SetFocus End If ' End If Next rst.Close cnn.Close uf_DisplayRecord = rst.RecordCount End Function I have another prolem too I have a form which has a subform and that subform must be in a datasheet view how to implement this form with a subform using VBA ( the method I have used or anything else ) without using bound forms. I thank every one who is spending time to read this post. I feel lucky if any one spend time to help me. Thanks a lot in advance. Kiran Karnati. |
|
#2
|
|||
|
|||
|
kkk
|
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > using a mdb file in a multiuser environment |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|