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

LVL 5
Haroon Ur RashidSr. Software EngineerAsked:
Who is Participating?
 
Alfred A.Connect With a Mentor Commented:
Hi,

Since you are using VB6, you can try using the data type "Variant" rather than Object in VB6.

In SQL Server 2000, you can use "sql_variant" data type to store your objects.

Check this out:

http://www.sqlteam.com/article/the-sql_variant-datatype

I hope this helps.
0
 
Haroon Ur RashidSr. Software EngineerAuthor Commented:
i need to know which datatype i wil use to store object and how can i store object in sql server (means vb6 code).
0
 
Haroon Ur RashidSr. Software EngineerAuthor Commented:
im also read some topic which asking about Serialize/Deserialize  in vb6 but do not mention how it will be work and example :(
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
BitsqueezerCommented:
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
0
 
Haroon Ur RashidSr. Software EngineerAuthor Commented:
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.
0
 
BitsqueezerCommented:
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
0
 
BanthorCommented:
varbinary(max)
0
 
Anthony PerkinsCommented:
Unfortunately the author is still using SQL Server 2000 so varbinary(MAX) is not an option.
0
 
Haroon Ur RashidSr. Software EngineerAuthor Commented:
Thanks man, you save me :)
0
All Courses

From novice to tech pro — start learning today.