Fabricated ADO recordset bound to form

spikepl

Eledittingent Beliped
Local time
Today, 19:40
Joined
Nov 3, 2010
Messages
6,142
I am looking for a complete working example of a fabricated ADO recordset bound to a form. The purpose of this is to provide a selection tool for records of a table in a multiuser database.

I could do this using a table to store the selections in the db, but I want to get a tool I can reuse in the future, obviating the need for extra tables and keeping track of users and multiple copies of the application ran by the same user.

So far I can display MEMO text, all the other values of my recordset (yes they are present) generate #ERROR in the form controls.Yes I did google. Apparently I am not the only one with this problem, but the solutions range from bizarre to weird.


Code:
            .Append "MailSubject", adLongVarWChar, 10000
'            .Append "MailSubject", adVarChar, 255
            .Append "MailBody", adLongVarWChar, 10000
            .Append "MailID", adBigInt
            .Append "MailTemplateID", adInteger
            .Append "RevisionID", adInteger
            .Append "SentOn", adDBTimeStamp
            .Append "myField", adInteger

If you do have a complete (with form) working example that includes at least one integer field in a record then can you please post the thing? TIA
 
You have an incompatible datatype.

adVarChar can only be used as a parameter in an ADO command.
 
Here's a sample. Makes a difference what cursortype and locktype you use to open the recordset . . .
 

Attachments

Arrrrrrrrrrrrgh.. I really have to read the documention.:banghead:

Cursor type seems to have been the culprit. Since I can't tell the difference from one to another, but grabbed my original code from the web, makes me wonder why their code worked for them but not me. Ah well. ..

Thank you - I was on the verge of dumping the entire idea and going for tables.
 
BTW - which ADO library should one put in References? There is a million of them.

I currently use A2010, but the code should hopefully run on A2007?
 
I avoid the library question by always using Late Binding for ADO.

Keep the reference during development for the intellisense then switch to Late Binding for distribution. The switch back and forwards can be done quickly with conditional compilation if that matters to the developer.
 
@Galaxiom

Of course
Facepalm-smiley-animated.gif
 

Users who are viewing this thread

Back
Top Bottom