Sql Validation For Text Input Box Data 追蹤

0
Avatar
Legacy Poster

Hi. I am looking for a way to check a value entered into a text input box on the data entry form against data in a single column of a SQL database. I’m fairly certain that this is possible with vbscript but do not know where to start. I can successfully query the SQL DB to fill a dropdown list, but I need help checking the value in a text input box and putting up a message for the user that says something to the effect of, “Invalid entry,” if they enter a value that does not exist in the DB. Any help provided would be appreciated.

6 意見

0
Avatar
Ian Cummings
版主
評論操作 永久連結

You need to use a query prompt rather than a data entry item.  See this video: http://www.seagullscientific.com/label-software/training-video-(selecting-records-from-a-database-at-print-time).aspx

0
Avatar
Legacy Poster
評論操作 永久連結

You need to use a query prompt rather than a data entry item.  See this video: http://www.seagullscientific.com/label-software/training-video-(selecting-records-from-a-database-at-print-time).aspx

The query on this column is independent from the main query, for which I use a regular query prompt. Is there a way to use a query prompt for two different queries?

0
Avatar
Ian Cummings
版主
評論操作 永久連結

In other words, you'd like to have a data entry form control source its data from a field in a database table based on a query just for that control (a list control by any chance) to act as a look-up?  Unfortunately BarTender doesn't support that directly as things stand, but can be worked around by using the VB script data source for the form control.  This forum post should help guide you: http://seagullscientific.invisionzone.com/index.php?/topic/2090-newbie-questions/?hl=textfruit#entry6481

0
Avatar
Legacy Poster
評論操作 永久連結

I can do a drop down list to SQL via vbscript - what I'm really trying to do is validate data typed into a text box. Is that possible with vb script? If so, do you have an example? Thanks for help.
0
Avatar
Shotaro Ito
評論操作 永久連結

Perhaps you need to write some SQL access script with CancelPrinting() in OnProcessData.

 

You can create custom validation using CancelPrinting.

http://forums.seagullscientific.com/index.php?/topic/715-vb-script-on-validation-at-prompt-dialog/?p=2099

0
Avatar
Legacy Poster
評論操作 永久連結

Perhaps you need to write some SQL access script with CancelPrinting() in OnProcessData.

 

You can create custom validation using CancelPrinting.

http://forums.seagullscientific.com/index.php?/topic/715-vb-script-on-validation-at-prompt-dialog/?p=2099

Thank you. I'll give that a go.

登入寫評論。