Problem using linked tables with vb5

G

gollum_hkt

Hi

I hope someone can help, I have a vb project that was previously
running on a standalone pc accessing an access97 database, I have now
had to modify it to work on multiple networked pcs, I have split the
database so that each pc has the front end in c:\aussie\BarDb97.mdb and
the back end on a mapped drive z:\aussie\BarDb97_be.mdb

The program runs until I try to modify any f the records it gives me
the error Run Time Error 3219 Invalid Operation

this is a sample of the code below:

Private Sub Form_Load()

Label2.Caption = gBinNo
Label4.Caption = gCustomer
Label6.Caption = gWaitress
Label8.Caption = gNextBillNo

Set db = OpenDatabase("c:\Aussie\BarDb97.mdb", False, False,
";pwd=backdoor")
Set rs = db.OpenRecordset("SELECT * FROM ViewBill")
rs.MoveFirst

Label9.Caption = "0"


Do While Not rs.EOF

Label9.Caption = Val(Label9.Caption) + (rs.Fields("Total"))
rs.MoveNext
Loop


Data1.RecordSource = "viewbill"
Data1.Refresh <================== This is where the program
breaks
' MsgBox (Data1.Recordset.Fields("Description"))

ViewBill.Refresh

rs.Close
db.Close

End Sub

What am I doing wrong?
 
M

MacDermott

I'm confused as to why you're opening the front end, rather than the back
end, where the data is...
 
G

gollum_hkt

Because just accessing the back end or the unsplit database on the
"server" pc from a "client" pc gives the error "couldn't find
c:\Aussie\BarDb97.mdb" even though I replaced all ocurrences in the
program with \\officepc\aussie\BarDb97.mdb. I've even tried mapping
\\officepc\aussie to z:\ a using that in the code and I stil get the
c:\aussie error
 
M

MacDermott

If it's still looking for c:\aussie, then something somewhere hasn't been
changed correctly.
Can you identify the line of code which produces this error?
BTW, mapping it to a drive letter is a good idea; I'd suggest pursuing that
approach.
 
G

gollum_hkt

Thanks I'll try thate mapped drive approach, I've searched through all
the code and there is no reference anywhere to c:\aussie they all point
to \\officepc\aussie
 
G

gollum_hkt

If I use an unsplit copy of the database with mapped z:\ drive or
\\officepc I get the 3219 error on remote PCs using the VB exe but on
the local PC the VB exe works fine. I think I haven't enabled
networking or something like that in the code somewhere.
 
G

gollum_hkt

Problem solved there was a hidden data control on the form that was
behind a button
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top