Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 05:07 pm EDT

Geeklog Forums

Converting Access database to story or forum


Nightvision

Anonymous
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?? Question Thanks!!
 Quote

Status: offline

jadiepoo

Forum User
Chatty
Registered: 01/11/03
Posts: 43
Try Access2MySQL When you converted from access, you\'ll need to probably make modifications on the db to match the forum/story tables.
 Quote

Status: offline

DTrumbower

Forum User
Moderator
Registered: 01/08/03
Posts: 507
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.
 Quote

Status: offline

DTrumbower

Forum User
Moderator
Registered: 01/08/03
Posts: 507
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.
 Quote

Nightvision

Anonymous
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
 Quote

Status: offline

DTrumbower

Forum User
Moderator
Registered: 01/08/03
Posts: 507
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.
 Quote

Nightvision

Anonymous
Thanks Dwight, i\'ll give it a shot.
 Quote

Nightvision

Anonymous
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??
 Quote

Status: offline

DTrumbower

Forum User
Moderator
Registered: 01/08/03
Posts: 507
I would go directly into sql view. No reason to select tables. You will type that in manually.
 Quote

All times are EDT. The time is now 05:07 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content