|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
I have a multiline textbox (txtMeterNum) and two singleline textboxes (txtDate and txtBatchNum). From a scaner we scan meter numbers to a .txt file, with a timer we put these numbers in the multiline textbox. They apear each in their own row. All of these must be updated to a SQL database with the same Date and Batch number as in txtDate and txtBatchNum. so if there are 10 meter numbers then there must be 10 new records with 10 diferent Meter numbers al with the same date and batch number.
I used ADODC |
|
#2
|
||||
|
||||
|
split the multi-line text using VB's Split function and vbEnter (or char 13) as the delimiter, loop through the output array creating and executing the required SQL on each loop.
The base SQL will be something like this: "INSET INTO TableName (Date, BatchNum, MeterNum) VALUES(" & txtDate & ", " & txtBatchNum & ", " For l = 0 to uBound(arrMeterNum) connection.execute sSQL & arrMeterNums(l) & ")" loop Hope this helps |
|
#3
|
||||
|
||||
|
Sounds like you should use a list control here instead of a multi-line text box.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Multiline TextBox to SQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|