13 Replies - 10774 Views - Last Post: 25 March 2010 - 06:29 PM Rate Topic: -----

#1 LenaMaths  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 04-March 10

To Convert Textfile or csv file DataBase to XML Format

Posted 04 March 2010 - 06:43 AM

Hello ,

I am new for VB6.
I have been trying to create a VB6 interface.
There will be some buttons on this interface. There will be a button named "Generate" . It should get csv files or text files and build them as a XML file. These csv files have 1000 lines.

But I have some questions :
- How I can collect my big csv files ( into a DB ) , with Acccess DB or something like that ?
- Can I create such a VB6 interface ?
-If I can , Can I call these csv files with VB6 ?
- If I can , What ways should I follow ? Do I need OLE DB using ?

I will be gratefull If someone can share his/her ideas or suggestions with me..

Thanks a lot..

Is This A Good Question/Topic? 0
  • +

Replies To: To Convert Textfile or csv file DataBase to XML Format

#2 vb5prgrmr  Icon User is offline

  • D.I.C Lover

Reputation: 109
  • View blog
  • Posts: 1,016
  • Joined: 21-March 09

Re: To Convert Textfile or csv file DataBase to XML Format

Posted 04 March 2010 - 07:00 AM

The answer to all your questions is YES...

Reading file see the following in the help files (or look at the top of this forum at the sticky's/pinned threads and look through them...)

FreeFile Function
Open Statement
Input Function or Line Input Function
Close Statement

Or you can use your friends (yahoo, google, ask, answers, bing) and search for...

vb6 text file tutorial
vb6 ado tutorial
vb6 common dialog tutorial
vb6 array tutorial
vb6 variable scope tutorial


Good Luck
Was This Post Helpful? 1
  • +
  • -

#3 LenaMaths  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 04-March 10

Re: To Convert Textfile or csv file DataBase to XML Format

Posted 04 March 2010 - 08:37 AM

I do thank yo.. I search on google and found many documents. I will look in details.

Could I ask if I need help after I worked on them ?


Many thanks again..
Was This Post Helpful? 0
  • +
  • -

#4 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 464
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: To Convert Textfile or csv file DataBase to XML Format

Posted 04 March 2010 - 08:43 AM

sure you can :)
Was This Post Helpful? 0
  • +
  • -

#5 LenaMaths  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 04-March 10

Re: To Convert Textfile or csv file DataBase to XML Format

Posted 08 March 2010 - 03:35 AM

Dear vb5prgmr ,

I searched all titles you wrote. They are useful.

I can create my data in an mbd file. For example I created a table is 18329 lines.

I want a button is generate this lines .
Do I can create a button like that connects Acccess coloums data with this xml formats data ?

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2"
  xmlns:gx="http://www.google.com/kml/ext/2.2">
  
  <gx:Tour>
    <name>Smooth tour example</name>
    
    <gx:Playlist>
      
      <gx:FlyTo>
        <gx:duration>4.0</gx:duration>
        <gx:flyToMode>smooth</gx:flyToMode>
        <LookAt>
          <longitude>-121.303179</longitude>
          <latitude>45.993041</latitude>
          <altitude>0</altitude>
          <heading>-27.923387</heading>
          <tilt>71.600075</tilt>
          <range>22570.546801</range>
          <altitudeMode>relativeToGround</altitudeMode>
        </LookAt>
      </gx:FlyTo>
      
      <gx:FlyTo>
        <gx:duration>4.0</gx:duration>
        <gx:flyToMode>smooth</gx:flyToMode>
        <LookAt>
          <longitude>-121.475387</longitude>
          <latitude>46.221911</latitude>
          <altitude>0</altitude>
          <heading>-71.951521</heading>
          <tilt>68.691278</tilt>
          <range>14448.998713</range>
          <altitudeMode>relativeToGround</altitudeMode>
        </LookAt>
      </gx:FlyTo>
      
      <gx:FlyTo>
        <gx:duration>4.0</gx:duration>
        <gx:flyToMode>smooth</gx:flyToMode>
        <LookAt>
          <longitude>-122.039669</longitude>
          <latitude>47.150637</latitude>
          <altitude>0</altitude>
          <heading>-42.695643</heading>
          <tilt>70.730178</tilt>
          <range>70732.558341</range>
          <altitudeMode>relativeToGround</altitudeMode>
        </LookAt>
      </gx:FlyTo>
      
      <gx:FlyTo>
        <gx:duration>4.0</gx:duration>
        <gx:flyToMode>smooth</gx:flyToMode>
        <LookAt>
          <longitude>-121.849107</longitude>
          <latitude>46.986296</latitude>
          <altitude>0</altitude>
          <heading>149.864810</heading>
          <tilt>58.696527</tilt>
          <range>9562.267238</range>
          <altitudeMode>relativeToGround</altitudeMode>
        </LookAt>
      </gx:FlyTo>
      
    </gx:Playlist>
  </gx:Tour>
</kml>


I am not good at Codes . I need a start way..
Was This Post Helpful? 0
  • +
  • -

#6 vb5prgrmr  Icon User is offline

  • D.I.C Lover

Reputation: 109
  • View blog
  • Posts: 1,016
  • Joined: 21-March 09

Re: To Convert Textfile or csv file DataBase to XML Format

Posted 08 March 2010 - 07:55 AM

Ahhh... I'm not sure as I'm not sure as to what you are trying to do...

Perhaps a little more information from you might be in order...



Good Luck
Was This Post Helpful? 0
  • +
  • -

#7 LenaMaths  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 04-March 10

Re: To Convert Textfile or csv file DataBase to XML Format

Posted 09 March 2010 - 02:07 AM

Dear vb5prgrmr ,

Firstly I should say that I am not a native english speaker / writer..

I want to create a xml file like I sent my previous message with VB6.
I will upload these xml / kml templates into google earth..

If it will be hard with VB6 , maybe I can try to learn VB.net frameworks..

1- How I can call access lines with VB6 ?
2- How I can convert this lines into XML lines ? I mean the bold values below should come form Access file. ( you can see test.jpg file ). I want my program to read access lines and convert them into xml lines if possible..


<gx:FlyTo>
<gx:duration>4.0</gx:duration>
<gx:flyToMode>smooth</gx:flyToMode>
<LookAt>
<longitude>-121.303179</longitude>
<latitude>45.993041</latitude>
<altitude>0</altitude>
<heading>-27.923387</heading>
<tilt>71.600075</tilt>
<range>22570.546801</range>
<altitudeMode>relativeToGround</altitudeMode>
</LookAt>
</gx:FlyTo>

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#8 vb5prgrmr  Icon User is offline

  • D.I.C Lover

Reputation: 109
  • View blog
  • Posts: 1,016
  • Joined: 21-March 09

Re: To Convert Textfile or csv file DataBase to XML Format

Posted 09 March 2010 - 06:50 AM

Ahhh.... a reference to XML v?.? and a tutorial on XML...
http://www.thescarms...mltutorial.aspx
http://www.thescarms...OMTutorial.aspx



Good Luck
Was This Post Helpful? 0
  • +
  • -

#9 Guest_LenaMaths*


Reputation:

Re: To Convert Textfile or csv file DataBase to XML Format

Posted 24 March 2010 - 12:39 AM

Dear vb5prgmr ,

I viewed all of them and I firstly try to do as Text File. I mean I gave up creating an XML file :( Bcos I cannot make my program to read my database.. So , I cannot create an easy xml tree :(

Could you suggest me anything ?

Thanks a lot..
Was This Post Helpful? 0

#10 vb5prgrmr  Icon User is offline

  • D.I.C Lover

Reputation: 109
  • View blog
  • Posts: 1,016
  • Joined: 21-March 09

Re: To Convert Textfile or csv file DataBase to XML Format

Posted 24 March 2010 - 05:16 AM

Okay, earler in this thread you said you could read data from a database, and now you are saying you can't?... Okay, with ADO, can you open up a database and read data from a table?
Was This Post Helpful? 0
  • +
  • -

#11 LenaMaths  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 04-March 10

Re: To Convert Textfile or csv file DataBase to XML Format

Posted 25 March 2010 - 01:57 AM

Dear Vb5prgrmr,

I only said "I can create my data in an mbd file. For example I created a table is 18329 lines."
I get my values from another program and convert them mbd file by manual.

I cannot make my program read my mbd file.I have been working on it. I hope I can get over .. :/

I want to ask that how can I collect all my seperated .dat files into a Dbase ? Can I do it with access and VB6 or SQL and VB6?

Thanks for all your replies and helps..
Was This Post Helpful? 0
  • +
  • -

#12 vb5prgrmr  Icon User is offline

  • D.I.C Lover

Reputation: 109
  • View blog
  • Posts: 1,016
  • Joined: 21-March 09

Re: To Convert Textfile or csv file DataBase to XML Format

Posted 25 March 2010 - 06:55 AM

Okay, lets get some terminology down here. When you say a database what do you mean??? A Microsoft Access Database *.mdb? A dBase table *.dbf? A FoxPro Table *.dbf? (and yes, foxpro is a fancy front end for dbase.) Microsoft SQL Server Version X.X? Oracle? Just plain text files?

When you say you create this database manually, what do you mean? (Show code)

Cannot access the data you put in??? Why not??? If you put it in why cannot you pull it out???
Was This Post Helpful? 0
  • +
  • -

#13 LenaMaths  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 04-March 10

Re: To Convert Textfile or csv file DataBase to XML Format

Posted 25 March 2010 - 08:30 AM

Dear Vb5prgrmr,

Ok I am telling step by step.

I have no permission to upload a csv / mbd file from my company. I will send you to night again.
I only attached a jpg file . Please look at it.


I will attach a .csv file named test and a mbd table. I use a program which gives outputs like this csv file per a second. ( I can get output types as csv, xls or dat file. )


I can only make the connection of csv file and access.

The goal of mine is that : take the height,latpc,longc and head values from csv or access file and send them to a text file.

Vb5prgrmr,
I think I make you bored.. I need a teacher maybe.. :( I am sorry...

Attached image(s)

  • Attached Image
  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#14 vb5prgrmr  Icon User is offline

  • D.I.C Lover

Reputation: 109
  • View blog
  • Posts: 1,016
  • Joined: 21-March 09

Re: To Convert Textfile or csv file DataBase to XML Format

Posted 25 March 2010 - 06:29 PM

No, you don't make me bored, you confuse me by saying one thing in one post and then saying something, the oppsite, in the next post... i.e. in one post above you say you can put information into your database but then you say you cannot get data back out...

So, to solve this problem you need to use your friends (yahoo, google, ask, answers, bing) and search for vb6 ado tutorial or see the faq section of this forum and read the ado tutorial(s). These will show you how to put data into and retrieve data from an access database.

Once you have that mastered or at least some working/sort of working code, come back and ask for help with it.

Also, as above, look up the FreeFile Function, Open Statement, Line Input Function, Split Function, and Close Statement...

That is all the information you need to open a text/csv file and insert records into an access database...



Good Luck
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1