Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem Saving ADO RecordSet to MSDE Database
Message
From
21/10/2002 20:11:35
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Problem Saving ADO RecordSet to MSDE Database
Miscellaneous
Thread ID:
00713730
Message ID:
00713730
Views:
50
Hi all,

I'm having some trouble saving a ADO recordset,

I have a DLL with a Connection, GetRS and Save Method, like the code above
OPEN Method -- DLL
THIS.lcConnection = ""
	this.oConnection  = CREATEOBJECT("adodb.connection")

	this.oConnection.OPEN( "DRIVER={SQL Server};" + ;
         			  "Server=localhost;"+ ;
		                  "DATABASE=jbempresas;"+ ;
		                  "UID=;" + ;
		                  "PASSWORD=;")
THIS.lcConnection = this.oConnection

GetRS -- DLL
LPARAMETERS lcChv1, lcTable

oRecordSet=CREATEOBJECT('adodb.recordset')

With oRecordSet 
	.ActiveConnection = This.lcConnection  &&oConnection
	.CursorLocation   = 3 && adUseClient
	.CursorType       = 2 && adDynamic
	.LockType         = 4 && adLockBatchOptimistic
	.Open("SELECT * FROM &lcTable where c_codigo= '"+lcChv1+"'",This.lcConnection)
	if .RecordCount<=0
		.AddNew
		oRecordSet.fields('c_RecordSet').value="0"
	 ELSE
	 	oRecordSet.fields('c_RecordSet').value="1"
	endif
endwith

RETURN oRecordSet

SAVE Method -- DLL
LPARAMETERS toRS
WITH toRS
	.oConnection.BeginTrans()
	toRS=ActiveConnection=.oConnection
	toRS.UpdateBatch
ENDWITH

FORM Code

LOAD FORM
WITH THIS
    .oConnect = createobject('gc_DataLayer.DataLayer')
    .oRs      = createobject('ADODB.RecordSet')
ENDWITH

ADDREC Form
   This.oConnect.Save(oRS)
The form get some values, the form fields are bound like .ORS.fields('c_codigo').value and ....

Nothing is Save in MSDE, what could be wrong here....

Thank's

João Batista
Next
Reply
Map
View

Click here to load this message in the networking platform