Link to home
Start Free TrialLog in
Avatar of Haroon Ur Rashid
Haroon Ur RashidFlag for Saudi Arabia

asked on

How to store a object in SQL server 2000

i am using digital persona fingerprint device which give me 10 object (each finger print) but the issue this these data type is object and i need to store them in sql server 2000. thanks in advance
Dim Templates(0 To 10) As Object

Private Sub DPFPEnrollmentControl1_OnEnroll(ByVal Mask As Long, ByVal Templ As Object, ByVal Stat As Object)
    ' Enrollment succeeded, so store the template.
SetTemplate Mask, Templ
   End If
End Sub

Public Sub SetTemplate(ByVal Mask As Long, ByVal Templ As Object)
  ' Store fingerprint template in the memory.
  Set Templates(Mask) = Templ
End Sub

Open in new window

Avatar of Haroon Ur Rashid
Haroon Ur Rashid
Flag of Saudi Arabia image

ASKER

i need to know which datatype i wil use to store object and how can i store object in sql server (means vb6 code).
im also read some topic which asking about Serialize/Deserialize  in vb6 but do not mention how it will be work and example :(
Avatar of Bitsqueezer
Hi,

an object of any kind consists of methods and properties. To fill an object with "life" you would normally instantiate an object and then set the properties to some values. Maybe the object's methods does this job for you by reading the data from an external device.
But the result is always the same: At the end an object should have a state which is represented by it's data. So you should be able to read out the properties and also to write them back into the object. If the object is read only you can of course read out and save the data but in this case you are not be able to restore the object later by reading it's data from the database. But maybe in the used class there are other objects able to do this.
So the first thing to find out is: How can you read out the data from the object and write it back to it without using an external device? Maybe there is already a method in the object to save and load the data as file? I would say, without these possibilities it would not make much sense in the case of a fingerprint scanner.
If you have found out how to read and write the properties than the next step is easy: Build a table which has a column for every property with a comparable datatype and store all the values and some kind of object identifier (for example the name of the user who gave his fingerprint and an ID) to be able to restore the object. Then you can read and write any object at any time - and of course with any database.

Cheers,

Christian
Bitsqueezer, thanks for your detail reply . i think you are taking about data object like Business objects which have simple fields with function etc... but in my case fingerprinting device give me output in the form of object which do not have attributes or function its fully encapsulate.... i think the way to store it in db is Serialization but i need an example how can i do it in vb6 app.
Hi,

if the object doesn't have any methods to work with - what's the sense of such an object? I mean, if you have a picture scanner you would expect to get back a picture which you can save. So I would expect from a fingerprint scanner to get at least a fingerprint picture or some biometric data which I can save. An object simply being an object - what should I do with it?

I know from Java that there is an serialization interface for all objects, but I don't know if there's something similar in VB6. Here is a link which may be helpful for your case:

http://www.vb-helper.com/howto_vb6_serialize.html

Cheers,

Christian
ASKER CERTIFIED SOLUTION
Avatar of Alfred A.
Alfred A.
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
varbinary(max)
Unfortunately the author is still using SQL Server 2000 so varbinary(MAX) is not an option.
Thanks man, you save me :)