Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6167267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:28:51+00:00 2026-05-23T22:28:51+00:00

NOTE:, I don’t need help with the generic concept of inserting data to a

  • 0

NOTE:, I don’t need help with the generic concept of inserting data to a database, just sorting through the contents of an array depending on the content of the “line” and how to determine which “items” in the array correspond to a field in the database


I have a glob of data posted to me by a desktop application that I need to sort through. My old solution worked, but was far less than elegant (INSERT each line of glob into database, then query for, reINSERT, and delete old).

How can I get the following chunk of information (POSTED to me as “f_data”) into an array and insert the data into a database?

f_data Contents:

Open~notepad.exe~7/14/2011 2:28:46 PM~COMPUTER01
Open~mspaint.exe~7/14/2011 2:28:55 PM~COMPUTER01
Close~notepad.exe~7/14/2011 2:30:06 PM~COMPUTER01
Close~mspaint.exe~7/14/2011 2:30:06 PM~COMPUTER01
Session~7/14/2011~336~COMPUTER01
Startup~7/18/2011 11:23:12 AM~COMPUTER01

Please keep in mind that I have never used arrays before. 15 years of ASP and I’ve never had to use an array. How I’ve been so lucky I don’t know, but I think that it may be required for this solution. Here is my current code to put “f_data” into an array:

Example of what I want to do:

var_logdata = request.form("f_data")
arr_logdata = Split(var_logdata,"~")
for var_arrayitem = 0 to ubound(arr_logdata)
'Do some stuff here depending on the log type
  'If type is "Open"
      'insert to tb_applicationlog
  'Elseif type is "Close"
      'insert to tb_applicationlog
  'Elseif type is "Session" 
      'insert to tb_sessions
  'End if
next

What I don’t know how to do is to determine what “type” of log entry the item in the array is. If you look at the code above, I need to insert to different tables in the database depending on the “type” of log entry. For example, an “Open” or “Close” entry goes into the tb_applicationlog table. Once I determine what type the log entry is, how do I align the items in the array “row” to fields in the database?

Thanks very much in advance,
Beems

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:28:51+00:00Added an answer on May 23, 2026 at 10:28 pm

    I think it would be better to split ‘logdata’ using another character first, then spilt the fields in the array created by ‘logdata’ using ‘~’, as below (code not tested) –

    var_logdata = request.form("f_data")
    arr_logdata = Split(var_logdata,vbCrLf) 
    'split request.form("f_data") using newline so we have an array containing each line 
    for var_arrayitem = 0 to ubound(arr_logdata)
        'now we can split each line by "~"
        arr_linelogdata = Split(arr_logdata(var_arrayitem),"~")
        'now arr_linelogdata(0) is log type, arr_linelogdata(1) is next field etc
        'linetype = arr_linelogdata(0) etc
        'use variables derived from array to do what you need to
    next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note:I don't mean some theoretical question which don't have any implementation just languages that
NOTE: I am not set on using VI, it is just the first thing
(Note: This is for MySQL's SQL, not SQL Server.) I have a database column
NOTE : I mention the next couple of paragraphs as background. If you just
Having a PrintTicket how to display the printer-specific configuration dialog? Note: I don't mean
NOTE: XMLIgnore is NOT the answer! OK, so following on from my question on
Note: This was posted when I was starting out C#. With 2014 knowledge, I
Note: Originally this question was asked for PostgreSQL, however, the answer applies to almost
Note that I am not asking which to choose (MVC or MVP), but rather
Note : The code in this question is part of deSleeper if you want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.