Windows 7 ADO

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
plywoodca
Newbie
Posts: 3
Joined: Fri Jan 04, 2008 5:22 pm

Windows 7 ADO

Post by plywoodca » Thu Jun 13, 2013 9:59 pm

I am using Macro Scheduler 9. I have a program compiled on a Windows XP machine that uses ADO to access a MS Access 2010 database and every thing works fine. When I run the same compiled program on a Windows 7 machine, it cannot access the database. Does this mean it needs to be compiled on a Windows 7 machine in order to run on a Windows 7 machine?

olllllliii
Pro Scripter
Posts: 60
Joined: Tue Dec 22, 2009 9:51 am
Location: Mannheim ( Germany )
Contact:

Post by olllllliii » Thu Jun 13, 2013 10:03 pm

Normally there is no Need to compile it on Windows 7 for use in Windows 7.

Did you try to run the executable with admin privileges ?
In most case it works fine.
Oliver Hilger Mannheim
alias Olllllliii

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Jun 14, 2013 6:58 am

Is Access and ADO installed on the Win 7 machine with the same drivers?

What error do you get?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Re: Windows 7 ADO

Post by armsys » Fri Jun 14, 2013 1:17 pm

plywoodca wrote:I am using Macro Scheduler 9. I have a program compiled on a Windows XP machine that uses ADO to access a MS Access 2010 database and every thing works fine. When I run the same compiled program on a Windows 7 machine, it cannot access the database. Does this mean it needs to be compiled on a Windows 7 machine in order to run on a Windows 7 machine?
Would you please show us the MS code in connection to the ADO?

plywoodca
Newbie
Posts: 3
Joined: Fri Jan 04, 2008 5:22 pm

Post by plywoodca » Fri Jun 14, 2013 6:17 pm

The error code is "3811 - Attempt to open a databse with the request record level locking failed; page level locking will be used." I believe this is just a warning and I have since added code to ignore it but what parameters do I need to set to avoid the warning?

The VBScript code is

Code: Select all

function ConnectDB()
  DBError="N"
  set cnn1 = CreateObject("ADODB.Connection")
  cnn1.Mode=adModeReadWrite
  cnn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=MyDB.mdb"
  If cnn1.Errors.Count > 0 Then
  	  For Each errLoop In cnn1.Errors
	  	  if errloop.SQLState <> "3811" then
		    strError = "Error #" & errLoop.Number & _
          	  "   " & errLoop.Description &  _
              "   (Source: " & errLoop.Source & ")" & _
              "   (SQL State: " & errLoop.SQLState & ")" & _
              "   (NativeError: " & errLoop.NativeError & ")"
            msgbox strError
			DBError="Y"
		  end if
      Next
  end if

  if DBError = "N" then
    ConnectDB = "Success"
  end if
end function

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Sun Jun 16, 2013 1:42 pm

Instad

Code: Select all

cnn1.Mode=adModeReadWrite
Try

Code: Select all

cnn1.Mode=adModeShareExclusive

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts