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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

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
Alfred A.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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.