Put search result into a variable

LSW
04-19-2004, 01:50 AM
Hi there,
I have read a thread by arnax asking a similar question but there is no reply yet, so I have created this thread.
Below is my code:

DataControl.RecordSource = "select * from TestAnsBank where TestId=2 AND TestNo= " & numArr(textBoxIndex) & ""

How do I put the searched text into a variable? Thanks a lot! :)

malloc
04-19-2004, 02:01 AM
You can use DAO or ADO to create recordset objects which can be filled by sql statements.

have a look here for to find some tutorials
http://www.visualbasicforum.com/showthread.php?t=39722

malloc

LSW
04-19-2004, 06:43 AM
Thanks for the prompt reply!

LSW
04-19-2004, 11:29 AM
Hi there,

Besides using ADO or DAO, is there a way to put the searched text into a variable?

Since I have always used the basic database command like Recordset and SQL and I have time limitations, I find it hard to learn ADO or DAO. Below is my code:

DataControl.RecordSource = "select * from TestAnsBank where TestId=2 AND TestNo= " & numArr(textBoxIndex) & ""

Can anybody help? Thanks! :)

reboot
04-19-2004, 11:32 AM
myVar = DataControl.Recordset.Fields("FieldName").Value

LSW
04-19-2004, 11:42 AM
Hi Reboot, It was so silly of me of not knowing the code...rather, it did not cross my mind of using it at the first place....thanks a lot! :D

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum