Posted on: 07/15/03 02:40pm
By: Anonymous (Nightvision)
I have an access database that I would like to convert to stories or forum posts. Each entry has an entry number, title, description and a few other fields. Does anyone know how I could easily convert this database to stories or forum posts??
Thanks!!
Re:Converting Access database to story or forum
Posted on: 07/15/03 02:54pm
By: jadiepoo
Try
Access2MySQL
When you converted from access, you\'ll need to probably make modifications on the db to match the forum/story tables.
Re:Converting Access database to story or forum
Posted on: 07/15/03 03:21pm
By: DTrumbower
Shouldn\'t be to hard. You can make INSERT SQL statements from the access data into the stories tables or topic table.
You would need to know certain fields that would need to be populated, like the sid, user security fields, etc.
If you want me to help, post the access table structure and I can generate some SQL for you or email me.
Re:Converting Access database to story or forum
Posted on: 07/16/03 12:15am
By: DTrumbower
This the minimum you would need.
INSERT INTO gl_stories( sid,date,title, introtext)
values( concat(CURDATE()+0, left(rand() * 1000000000,9)), curdate(), \"New title\", \"intro text\");
This will add a story to the General topic as anon. If you want to add the stories as admin, you would need to add the uid colum in the INSERT INTO clause and add the number 2 to the values.
INSERT INTO gl_stories( sid,date,title, introtext, uid)
values( concat(CURDATE()+0, left(rand() * 1000000000,9)), curdate(), \"New title\", \"intro text\",2);
If you want a different topic then add the column tid and then add \"a different topic\".
From access you can use SQL to create SQL, which will make your job a lot easier. You would do something like this.
Select \'INSERT INTO gl_stories( sid,date,title, introtext)
values( concat(CURDATE()+0, left(rand() * 1000000000,9)), curdate(), \"\' + field1 + \'\",\"\' + \"field2 + \'\");\"
That should get you going.
Re:Converting Access database to story or forum
Posted on: 07/16/03 07:44am
By: Anonymous (Nightvision)
Thanks Dwight!! I am not really sure though what to do with this code? Sorry for being ignorant. Do i enter this into the tables via phpmyadmin? Do I insert everything including INSERT INTO?
Thanks
Re:Converting Access database to story or forum
Posted on: 07/16/03 08:21am
By: DTrumbower
In access, create a new query and switch to SQL view. Copy this Select \'INSERT INTO gl_stories( sid,date,title, introtext)
values( concat(CURDATE()+0, left(rand() * 1000000000,9)), curdate(), \"\' + field1 + \'\",\"\' + \"field2 + \'\") FROM TABLE1;\"
Subsitute the correct table fields for field1 and field2. Change the Table1 to the correct table. Run the query and it should produce SQL records that you would copy and paste into phpmyadmin to execute.
Re:Converting Access database to story or forum
Posted on: 07/16/03 09:08am
By: Anonymous (Nightvision)
Thanks Dwight, i\'ll give it a shot.
Re:Converting Access database to story or forum
Posted on: 07/16/03 12:58pm
By: Anonymous (Nightvision)
I assume i go into Access and select create query in design view, select the tables and then go to sql view? When I do that I get an error saying characters found after SQL statement. Any ideas??
Re:Converting Access database to story or forum
Posted on: 07/16/03 04:15pm
By: DTrumbower
I would go directly into sql view. No reason to select tables. You will type that in manually.