You are on page 1of 1

Sir,

Kindly refer the following codes for merging the database for an
y number for weigh bridges.
step 1: share the database folder in the main system
2: map a network mostly drive Z to the shared db from other computers
3: make odbc connection for the db in drive z
use any dsn name, here i have used 'BRIDGE".
then modify the db open module as follows
Public Sub db_open()
On Error GoTo 10
If cn.State = 0 Then
cn.Open "DSN=BRIDGE;uid=sa;"
' cn.Open "DSN=BRIDGE;uid=sa;pwd = <your password>;" 'use this if your db has pa
ssword.
End If
Exit Sub
10: cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data S
ource=Z:\ncms.mdb"
'cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\CMS\NCMS.mdb;Persist S
ecurity Info=False;Jet OLEDB:Database Password = <your password>" 'use this if y
our db has password
End Sub
then modify the weighment frm "IN" command this is must for recno. otherwise the
recno will conflict while weighing the empty vehicle.
uma:
rsu.Open "select * from tblweight where recno = " & a
'MsgBox rsu.State
If rsu.RecordCount > 0 Then
a = a + 1
rsu.Close
'MsgBox rsu.State
GoTo uma
End If
rsu.Close
Thats all for the linking of the database. Thank you sir.

You might also like