I have a network Excel file that connects to an Access db using vba code. Several workstations were upgraded from Win XP to Win 7 32bit and Office 2010. After that upgrade those workstations are now not able to connect to the and they keep popping up run time error 3151.
What's going on? How can I fix this?
Code:
Public Const dest_db_file = "\\na02.ds-invest.local\data$\Gemel\Dash\pizulim\pizulim.mdb"
Sub load_hafkadot()
Dim the_db As Database
Dim the_rec As Recordset
If Range("c3").Value = "" Then
Set the_db = OpenDatabase(dest_db_file)
the_str = "select * from Viewhafkadot_mavar_masik where hesbon='" & Format(Range("c2").Value, "000000") & "'"
Set the_rec = the_db.OpenRecordset(the_str) 'this is the line that causes the prblem
End sub