Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 170
  • Last Modified:

VB database reading

hey folks
i need help.i want to send a questionarire to a user. ask him to fill the details and resend the file . i wnt to know how do i read it back the saved information into the database ??
pls let me know
sn_sudha
0
sn_sudha
Asked:
sn_sudha
2 Solutions
 
meyerc74Commented:
if the user is sending you back a file,an approach would be to open the file and read the line and then insert the data into the database. something like this:

dim lconfigFilePath, ltmpLine, ldestinationDirectory, lsourceDirectory, lconnectionString, lqueryString, lnewFileName

lconfigFilePath = "faxyLadyManagerConfig.cfg"

set fobj = createObject("scripting.fileSystemObject")
set configFile = fobj.openTextFile(lconfigFilePath,1)

'LOOP THROUGH CONFIG FILE GETTING PARAMETERS
do while not configFile.atendofstream
     ltmpLine = configFile.readline
     
     if ( left(ltmpLine,1) = "D") then
          ldestinationDirectory = configFile.readline
     end if
     
     if ( left(ltmpLine,1) = "F") then
          lsourceDirectory = configFile.readline
     end if
     
     if ( left(ltmpLine,1) = "S") then
               lconnectionString = configFile.readline
     end if
loop

'FINISHED WITH CONFIG FILE - DESTROY
set configFile = nothing

then do your database stuff.

there above is a vbscript file i wrote.  basically what it does is open a config file, and get the values for source directory, destionation directory and SQL connection string.
0
 
prd00Commented:
The easiest thing is using CSV. Depend on what VB you use.. This is using VB6.

dim TempLine as string, Fields() as variant

open "file.csv" for input as 1
do while not eof(1)
  lineinput #1, TempLine
  Fields = split(TempLine, ",")
  'Process your data here..
loop
0
 
CleanupPingCommented:
sn_sudha:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now