How do I use adodc to connect to a user-level security database(access2000)? a user-level security database is set by user-level security wizard and have name "simon" password "1234"

I have try it from adodc property to build a connection string :

Provider=microsoft.jet.OLEDB.40.datasource=c:\data\security.mdw;persistsecurityinfo=false

when it run come out with:adodc1.cannot start your application. The workgroup information files is missing or open exclusively by another user.

stop at this line :adodc1.refresh (the data can't go to datagrid on the form)

I already search the forum for this probs. but no result. If anyone can help is greatly appreciated. thanks in advance

VB Code:
  1. Dim cnn As New ADODB.Connection
  2. Dim rs As New ADODB.Recordset
  3.  
  4. Dim Total As Double
  5.  
  6. Private Sub cmdKeluar_Click()
  7.  
  8. Unload Me
  9.  
  10. Call Menu_Bisa
  11.  
  12. End Sub
  13.  
  14.  
  15. Private Sub Form_Load()
  16. Dim Koneksi As String
  17.  
  18. 'Driver ODBC Connection String
  19. Koneksi = "FILE NAME=C:\Program Files\" & _
  20. "Common Files\ODBC\Data Sources\dbinventori.dsn"
  21.  
  22.  
  23. cnn.Open Koneksi, "simon", "1234"
  24.  
  25. Call Detail
  26.  
  27. cmdtambah.Enabled = False
  28. cmdsimpan.Enabled = False
  29. cmdhapus.Enabled = False
  30. cmdbatal.Enabled = False
  31.  
  32. Total = 0
  33.  
  34. End Sub
  35.  
  36. Private Sub Form_Unload(Cancel As Integer)
  37.  
  38. cnn.Close
  39.  
  40. Set cnn = Nothing
  41.  
  42. End Sub
  43.  
  44. Private Sub mseHarga_KeyPress(KeyAscii As Integer)
  45.  
  46. If KeyAscii = 13 Then
  47.     SendKeys vbTab
  48. End If
  49.  
  50. End Sub
  51.  
  52. Private Sub txtKode_KeyPress(KeyAscii As Integer)
  53.  
  54. If KeyAscii = 13 Then
  55.    
  56.     SendKeys vbTab
  57. Else
  58.  
  59.     KeyAscii = Asc(UCase(Chr(KeyAscii)))
  60.    
  61. End If
  62.  
  63. End Sub
  64.  
  65. Private Sub mseJumlah_LostFocus()
  66. Dim TotalBrg As Double
  67.  
  68. If txtkodebarang.Text <> "" Then
  69.    
  70.     cnn.BeginTrans
  71.    
  72.     TotalBrg = Val(mseharga.Text) * Val(msejumlah.Text)
  73.    
  74.     Total = Total + TotalBrg
  75.    
  76.     msql = "Insert into tbNotaBeliDetail(NoNota,KodeBarang," & _
  77.         " NamaBarang,HargaBeli,Satuan,Jumlah,Total)" & _
  78.         " Values('" & txtnota.Text & "','" & txtkodebarang.Text & "', " & _
  79.         " '" & txtnamabarang.Text & "'," & Val(mseharga.Text) & "," & _
  80.         " '" & txtsatuan.Text & "'," & Val(msejumlah.Text) & "," & _
  81.         " " & Val(TotalBrg) & ")"
  82.            
  83.     cnn.Execute (msql)
  84.    
  85.     cnn.CommitTrans
  86.    
  87.     Call Detail
  88.    
  89.     txtkodebarang.SetFocus
  90.    
  91.     txtkodebarang.Text = ""
  92.     txtnamabarang.Text = ""
  93.     txtsatuan.Text = ""
  94.     mseharga.Text = ""
  95.     msejumlah.Text = ""
  96.    
  97.     msesubtotal.Text = Total
  98.     msetotal.Text = Total
  99.    
  100. End If
  101.  
  102. End Sub
  103.  
  104. Private Sub msePotongan_LostFocus()
  105.  
  106. msetotal.Text = Total - Val(msepotongan.Text)
  107.  
  108. End Sub
  109.  
  110. Private Sub txtKodeBarang_LostFocus()
  111. Dim msql As String
  112.  
  113. If txtkodebarang.Text <> "" Then
  114.    
  115.     msql = "select * from tbBarang " & _
  116.         " where kode='" & txtkodebarang.Text & "'"
  117.    
  118.     Set rs = cnn.Execute(msql)
  119.    
  120.     If Not rs.EOF Then
  121.         txtnamabarang.Text = rs.Fields("Nama")
  122.         mseharga.Text = rs.Fields("HargaBeli")
  123.         txtsatuan.Text = rs.Fields("Satuan")
  124.     End If
  125.     rs.Close
  126.    
  127. End If
  128.  
  129. End Sub
  130.  
  131. Private Sub txtKodePemasok_LostFocus()
  132. Dim msql As String
  133.  
  134. If txtkodepemasok.Text <> "" Then
  135.    
  136.     msql = "select * from tbpemasok " & _
  137.         " where kode='" & txtkodepemasok.Text & "'"
  138.    
  139.     Set rs = cnn.Execute(msql)
  140.    
  141.     If Not rs.EOF Then
  142.         txtnamapemasok.Text = rs.Fields("Nama")
  143.        
  144.     End If
  145.     rs.Close
  146.    
  147. End If
  148.  
  149. End Sub
  150.  
  151. Private Sub txtNota_LostFocus()
  152. Dim msql As String
  153.  
  154. If txtnota.Text <> "" Then
  155.     cnn.BeginTrans
  156.    
  157.     msql = "select * from tbNotaBeli " & _
  158.         " where NoNota='" & txtnota.Text & "'"
  159.    
  160.     Set rs = cnn.Execute(msql)
  161.    
  162.     If Not rs.EOF Then
  163.        
  164.         dptanggal.Value = rs.Fields("Tanggal")
  165.         txtkodepemasok.Text = rs.Fields("KodePemasok")
  166.         txtnamapemasok.Text = rs.Fields("NamaPemasok")
  167.         txtketerangan.Text = rs.Fields("Keterangan")
  168.         msesubtotal.Text = rs.Fields("SubTotal")
  169.         msepotongan.Text = rs.Fields("Potongan")
  170.         msetotal.Text = rs.Fields("TotalAkhir")
  171.        
  172.         Call Detail
  173.        
  174.         txtnota.Enabled = False
  175.         txtkodepemasok.Enabled = False
  176.         txtnamapemasok.Enabled = False
  177.         txtketerangan.Enabled = False
  178.         msesubtotal.Enabled = False
  179.         msepotongan.Enabled = False
  180.         msetotal.Enabled = False
  181.        
  182.         txtkodebarang.Enabled = False
  183.         txtnamabarang.Enabled = False
  184.         txtsatuan.Enabled = False
  185.         mseharga.Enabled = False
  186.         msejumlah.Enabled = False
  187.        
  188.         cmdtambah.Enabled = True
  189.         cmdhapus.Enabled = True
  190.                        
  191.     Else
  192.              
  193.         cmdsimpan.Enabled = True
  194.         cmdbatal.Enabled = True
  195.        
  196.     End If
  197.  
  198.     rs.Close
  199.    
  200.     cnn.CommitTrans
  201.  
  202. End If
  203.  
  204. End Sub
  205.  
  206. Private Sub txtNama_KeyPress(KeyAscii As Integer)
  207.  
  208. If KeyAscii = 13 Then
  209.    
  210.     SendKeys vbTab
  211. Else
  212.  
  213.     KeyAscii = Asc(UCase(Chr(KeyAscii)))
  214.    
  215. End If
  216.  
  217. End Sub
  218.  
  219. Private Sub mseJumlah_KeyPress(KeyAscii As Integer)
  220.  
  221. If KeyAscii = 13 Then
  222.     SendKeys vbTab
  223. End If
  224.  
  225. End Sub
  226.  
  227. Private Sub msePotongan_KeyPress(KeyAscii As Integer)
  228.  
  229. If KeyAscii = 13 Then
  230.     SendKeys vbTab
  231. End If
  232.  
  233. End Sub
  234.  
  235. Private Sub mseSubTotal_KeyPress(KeyAscii As Integer)
  236.  
  237. If KeyAscii = 13 Then
  238.     SendKeys vbTab
  239. End If
  240.  
  241. End Sub
  242.  
  243. Private Sub mseTotal_KeyPress(KeyAscii As Integer)
  244.  
  245. If KeyAscii = 13 Then
  246.     SendKeys vbTab
  247. End If
  248.  
  249. End Sub
  250.  
  251. Private Sub txtKeterangan_KeyPress(KeyAscii As Integer)
  252.  
  253. If KeyAscii = 13 Then
  254.    
  255.     SendKeys vbTab
  256. Else
  257.  
  258.     KeyAscii = Asc(UCase(Chr(KeyAscii)))
  259.    
  260. End If
  261.  
  262. End Sub
  263.  
  264. Private Sub txtKodeBarang_KeyPress(KeyAscii As Integer)
  265.  
  266. If KeyAscii = 13 Then
  267.    
  268.     SendKeys vbTab
  269. Else
  270.  
  271.     KeyAscii = Asc(UCase(Chr(KeyAscii)))
  272.    
  273. End If
  274.  
  275. End Sub
  276.  
  277. Private Sub txtKodePemasok_KeyPress(KeyAscii As Integer)
  278.  
  279. If KeyAscii = 13 Then
  280.    
  281.     SendKeys vbTab
  282. Else
  283.  
  284.     KeyAscii = Asc(UCase(Chr(KeyAscii)))
  285.    
  286. End If
  287.  
  288. End Sub
  289.  
  290. Private Sub txtNamaBarang_KeyPress(KeyAscii As Integer)
  291.  
  292. If KeyAscii = 13 Then
  293.    
  294.     SendKeys vbTab
  295. Else
  296.  
  297.     KeyAscii = Asc(UCase(Chr(KeyAscii)))
  298.    
  299. End If
  300.  
  301. End Sub
  302.  
  303. Private Sub txtNamaPemasok_KeyPress(KeyAscii As Integer)
  304.  
  305. If KeyAscii = 13 Then
  306.    
  307.     SendKeys vbTab
  308. Else
  309.  
  310.     KeyAscii = Asc(UCase(Chr(KeyAscii)))
  311.    
  312. End If
  313.  
  314. End Sub
  315.  
  316. Private Sub txtNota_KeyPress(KeyAscii As Integer)
  317.  
  318. If KeyAscii = 13 Then
  319.    
  320.     SendKeys vbTab
  321. Else
  322.  
  323.     KeyAscii = Asc(UCase(Chr(KeyAscii)))
  324.    
  325. End If
  326.  
  327. End Sub
  328.  
  329. Private Sub txtSatuan_KeyPress(KeyAscii As Integer)
  330.  
  331. If KeyAscii = 13 Then
  332.    
  333.     SendKeys vbTab
  334. Else
  335.  
  336.     KeyAscii = Asc(UCase(Chr(KeyAscii)))
  337.    
  338. End If
  339.  
  340. End Sub
  341.  
  342. Sub Kosong()
  343.  
  344. txtnota.Text = ""
  345. txtkodepemasok.Text = ""
  346. txtnamapemasok.Text = ""
  347. txtketerangan.Text = ""
  348. msesubtotal.Text = ""
  349. msepotongan.Text = ""
  350. msetotal.Text = ""
  351.  
  352. txtkodebarang.Text = ""
  353. txtnamabarang.Text = ""
  354. txtsatuan.Text = ""
  355. mseharga.Text = ""
  356. msejumlah.Text = ""
  357.  
  358. Total = 0
  359.  
  360. End Sub
  361.  
  362. Sub Detail()
  363. Dim msql As String
  364.  
  365. msql = "select KodeBarang,NamaBarang," & _
  366.     " HargaBeli,Jumlah, Total" & _
  367.     " From tbNotaBeliDetail " & _
  368.     " Where NoNota='" & txtnota.Text & "'"
  369.  
  370. Adodc1.RecordSource = msql
  371. Adodc1.Refresh [B]'Stop here[/B]
  372.  
  373. dgdetail.Refresh
  374.  
  375. End Sub