Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search Form

Status
Not open for further replies.

gasx

Technical User
Feb 28, 2003
22
US
I use this code below to find record for client in client form. My problem when I run the application I get this error message.

Cannot start you application. The workgroup information file is missing or open exclusively by another user.

Dim Conn2 As ADODB.Connection
Dim Rs1 As ADODB.Recordset

Dim SQLCode As String

Set Conn2 = New ADODB.Connection
Set Rs1 = New ADODB.Recordset

Conn2.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = C:\Documents and Settings\Gasim\My Documents\New changes\Copy of Hipaa code\MC-HIPPA.mdb;Password =H1pPaCla1M;"

SQLCode = "SELECT * FROM CLIENT WHERE CLIENTID = FIRSTNAME;"
Rs1.Open SQLCode, Conn2, adOpenStatic, adLockOptimistic
' Note: do normal rs1! or rs1. stuff from now on like
Me.txtPatFirstName = Rs1!FirstName


' close it this way
Set Rs1 = Nothing
Set Conn2 = Nothing

Can some one help me.
 
It looks like your db expects workgroup file. Make sure it's security settings set right. Thoughrouly go through all the security settings in the db (change some if they look suspisious and look at the result). Go through the code also, you might open db exclisively somehow. Before the testing make sure no ldb files exist.

vladk

PS: Don't show your password to the entire world.
 
i use this code below to find record on the form. is working fine without error. my problem when it show me msgbox "record found" it doesn't call my client record on my client inforamtion form. i think i need to add more code to pull my client record if it show that the record exist.

Private Sub Command1_Click()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\jsdegard\Desktop\PieceWeight.mdb;User Id=admin;Password=;"

Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "Select * From tblmain Where partno = '" & Text0.Text & "'", cn, adOpenKeyset, adLockOptimistic, -1

If rs.BOF And rs.EOF Then
MsgBox "No records match the current criteria!", vbCritical
Else
MsgBox "Record Found!", vbInformation
End If
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top