Error using ADO
From: Darwood (darrenw_at_nospamme.woodfordcomputers.co.uk)
Date: 08/12/04
- Next message: Rush Strong: "Re: grid and textbox and alter value"
- Previous message: Hugo M. Ranea: "Re: How to find if an exe is running."
- Next in thread: swdev2: "Re: Error using ADO"
- Reply: swdev2: "Re: Error using ADO"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 12 Aug 2004 17:08:47 +0100
I have created a middle tier project and am trying to pass the data up to
the presentation tier using ADO. When I try to move (If !objCustomers.EOF
MoveFirst etc) through the recordset from the top tier I get a message
saying "Runtime 3704: Operation is not allowed when the object is closed"
I am therefore trying to just create a simple ADO example without using 3
tier model. This too is giving me grief. I get the message "OLE exception
error: Exception code c0000005 OLE object may be corrupt"
My Customer on a separate machine has replicated the first problem but not
the second. Is it the ADO OLE object that is corrupt? How do I repair my ADO
objects?
I have got the VFP8 OLE DB Provider from the web installed.
I have put the code below that causes the second error.
#include "ADOVFP.H"
Set Step On
loCustomers = GetCustomers()
Function GetCustomers
loConnection = CreateObject("ADODB.Connection")
**************************************************
** This connection string must be parameterised **
**************************************************
lcConnectionString = "provider=vfpoledb;data source=" +
"C:\operaii\data\comp_z.dbc"
loConnection.ConnectionString = lcConnectionString
loConnection.Open
lcFilter = ""
loRS = CreateObject("ADODB.Recordset")
With loRS
.ActiveConnection = loConnection
.Source = "sname"
.CursorType = adOpenStatic
.LockType = adLockReadOnly
.CursorLocation = adUseClient
.Open() && This is the line that gives exception code c0000005
.Filter = lcFilter
EndWith
Return loRS
EndFunc
-- Regards Darren Woodford - MCP, MCSE Woodford Computer Systems Ltd http://www.woodfordcomputers.co.uk http://www.pegasus-opera-ii.co.uk
- Next message: Rush Strong: "Re: grid and textbox and alter value"
- Previous message: Hugo M. Ranea: "Re: How to find if an exe is running."
- Next in thread: swdev2: "Re: Error using ADO"
- Reply: swdev2: "Re: Error using ADO"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|