Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Tools or Ways of csv,txt files write to database
QtWS25 Last Chance

Tools or Ways of csv,txt files write to database

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 191 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Puppy BearP Offline
    Puppy BearP Offline
    Puppy Bear
    wrote on last edited by Puppy Bear
    #1

    Greetings,
    I'm trying to use Qtsql with Database right now,
    It seems like I am able to try to use some delimiter-separated values files to modify my Database
    with csv files.
    So that It makes it possible for someone else to modify my database according a csv file without changing my program.(some kind of interface I guess)

    the file might be like:

    <CreateTables>  <!--增加表 -->
    	<Table>
    		<TableName>Student1</TableName>  <!--表的名字 -->
    		<FieldList>Name|Age|Gender</FieldList>   <!--字段名字  用|来分割   字段个数和字段类型数一定要一一对应--> 
    		<FieldTypeList>VARCHAR(32)|INT|VARCHAR(8)</FieldTypeList>  <!--字段类型  用|来分割-->
    	</Table>	
    	<Table>
    		<TableName>Student2</TableName>  <!--表的名字 -->
    		<FieldList>Name|Age|Gender</FieldList>   <!--字段名字  用|来分割--> 
    		<FieldTypeList>VARCHAR(32)|INT|VARCHAR(8)</FieldTypeList>  <!--字段类型  用|来分割  字段个数和字段类型数一定要一一对应-->
    	</Table>
    </CreateTables>
    

    But I'm not sure is there any documents cause I have googled and found nothing,
    including all the syntax in the csv file, class I should try to use and so on
    Thanks in advance.
    Regards.

    JonBJ 1 Reply Last reply
    0
    • Puppy BearP Offline
      Puppy BearP Offline
      Puppy Bear
      wrote on last edited by
      #2

      Guess I'm missing the point, the main problem is to read a xml file with Qt, then I would be able to use xml's message (insert charts, add columns) as a regular sql order.

      1 Reply Last reply
      0
      • Puppy BearP Puppy Bear

        Greetings,
        I'm trying to use Qtsql with Database right now,
        It seems like I am able to try to use some delimiter-separated values files to modify my Database
        with csv files.
        So that It makes it possible for someone else to modify my database according a csv file without changing my program.(some kind of interface I guess)

        the file might be like:

        <CreateTables>  <!--增加表 -->
        	<Table>
        		<TableName>Student1</TableName>  <!--表的名字 -->
        		<FieldList>Name|Age|Gender</FieldList>   <!--字段名字  用|来分割   字段个数和字段类型数一定要一一对应--> 
        		<FieldTypeList>VARCHAR(32)|INT|VARCHAR(8)</FieldTypeList>  <!--字段类型  用|来分割-->
        	</Table>	
        	<Table>
        		<TableName>Student2</TableName>  <!--表的名字 -->
        		<FieldList>Name|Age|Gender</FieldList>   <!--字段名字  用|来分割--> 
        		<FieldTypeList>VARCHAR(32)|INT|VARCHAR(8)</FieldTypeList>  <!--字段类型  用|来分割  字段个数和字段类型数一定要一一对应-->
        	</Table>
        </CreateTables>
        

        But I'm not sure is there any documents cause I have googled and found nothing,
        including all the syntax in the csv file, class I should try to use and so on
        Thanks in advance.
        Regards.

        JonBJ Online
        JonBJ Online
        JonB
        wrote on last edited by
        #3

        @Puppy-Bear said in Tools or Ways of csv,txt files write to database:

        It seems like I am able to try to use some delimiter-separated values files to modify my Database

        The above is not a CSV file, it's an XML file. Looks like some description of the fields in tables.

        How do you/users use this to alter data in the database? And what does it have to do with Qt?

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved