A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

loading tables via SQL script



 
 
Thread Tools Display Modes
  #1  
Old February 12th, 2009, 07:45 PM posted to microsoft.public.access.gettingstarted
ps56k
external usenet poster
 
Posts: 9
Default loading tables via SQL script

Is this an embedded SQL script for defining & re-loading the tables ?

If MS Access can support this technique,
and all the SQL commands used are valid for MS Access,
then where and how do I point Access at the script ?
Are there parts missing ?

Just trying to get all the html blob data from the old website into a place
where we can review and export it back out into new physical web pages.

I have what appears to be a plain text backup file
from Wordpress used on a now closed team website.

The website we used for one of our teams
was not renewed last year, and is gone.

I have all the files, including what appears to be a backup file
of the Wordpress blog used to maintain the website.
A snipet is included below.
How can I use this backup file to load an MS Access database ?
It appears to be a list of SQL commands
with the actual text data embedded within the stream.

I really just want a single table - the one with all the formatted text
blog
entries...
-----


DROP TABLE IF EXISTS `wp_posts`;
#
# Table structure of table `wp_posts`
#
CREATE TABLE `wp_posts` (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`post_author` bigint(20) NOT NULL default '0',
`post_date` datetime NOT NULL default '0000-00-00 00:00:00',
`post_date_gmt` datetime NOT NULL default '0000-00-00 00:00:00',
`post_content` longtext NOT NULL,
`post_title` text NOT NULL,
`post_category` int(4) NOT NULL default '0',
`post_excerpt` text NOT NULL,
`post_status`
enum('publish','draft','private','static','object' ,'attachment','inherit','future')
NOT NULL default 'publish',
`comment_status` enum('open','closed','registered_only') NOT NULL default
'open',
`ping_status` enum('open','closed') NOT NULL default 'open',
`post_password` varchar(20) NOT NULL default '',
`post_name` varchar(200) NOT NULL default '',
`to_ping` text NOT NULL,
`pinged` text NOT NULL,
`post_modified` datetime NOT NULL default '0000-00-00 00:00:00',
`post_modified_gmt` datetime NOT NULL default '0000-00-00 00:00:00',
`post_content_filtered` text NOT NULL,
`post_parent` bigint(20) NOT NULL default '0',
`guid` varchar(255) NOT NULL default '',
`menu_order` int(11) NOT NULL default '0',
`post_type` varchar(20) NOT NULL default 'post',
`post_mime_type` varchar(100) NOT NULL default '',
`comment_count` bigint(20) NOT NULL default '0',
PRIMARY KEY (`ID`),
KEY `post_name` (`post_name`),
KEY `type_status_date` (`post_type`,`post_status`,`post_date`,`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=233 DEFAULT CHARSET=latin1 ;

#

# Data contents of table `wp_posts`
#
INSERT INTO `wp_posts` VALUES (2, 2, '2006-02-11 11:52:32', '2006-02-11
19:52:32', 'p align="center" /p\r\np align="center"font
size="4"strongWelcome to Naperville North Boys Track & Fieldbr
/\r\n/strongemHome of the Huskies!br /\r\n/em/fontfont
size="4"br /\r\n/font/p\r\np align="left"font size="1"The Boys
Track and Field Team provides student athletes an opportunity to feel good
about themselves and their performances. We focus on PRs or Personal
Records
which indicate improvement as result of committment to the team, its
coaches, and to oneself. The Huskies believe in measuring individual
performance by measuring their teammates accomplishments. In doing so,
student athletes invest in their fellow team members and enhance their own
ability to achieve PRs. Most of all, we love to compete and have fun!
/font/p\r\np align="left"The subpages to the right should supply you
with all the information you will need regarding the details of our
program.
In addition, their are numerous printable PDF forms for your
convience./p\r\np align="left"Thanks for visiting our site.
.........................................




  #2  
Old February 12th, 2009, 10:03 PM posted to microsoft.public.access.gettingstarted
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default loading tables via SQL script

You can use similar scripts within VBA code or in a query like:

CREATE TABLE tblContacts
([ContactID] counter,
[LastName] text (30),
[FirstName] text (30),
[FullName] text (60),
[ContactDate] date,
[Notes] memo,
CONSTRAINT [ContactID] PRIMARY KEY ([ContactID]));

CREATE UNIQUE INDEX FullName ON tblContacts (LastName, FirstName);

In VBA, you'd do:

Dim strSQL
strSQL = "CREATE UNIQUE INDEX FullName ON tblContacts (LastName,
FirstName);"
CurrentDB.Excecute strSQL
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"ps56k" wrote in message
...
Is this an embedded SQL script for defining & re-loading the tables ?

If MS Access can support this technique,
and all the SQL commands used are valid for MS Access,
then where and how do I point Access at the script ?
Are there parts missing ?

Just trying to get all the html blob data from the old website into a
place
where we can review and export it back out into new physical web pages.

I have what appears to be a plain text backup file
from Wordpress used on a now closed team website.

The website we used for one of our teams
was not renewed last year, and is gone.

I have all the files, including what appears to be a backup file
of the Wordpress blog used to maintain the website.
A snipet is included below.
How can I use this backup file to load an MS Access database ?
It appears to be a list of SQL commands
with the actual text data embedded within the stream.

I really just want a single table - the one with all the formatted text
blog
entries...
-----


DROP TABLE IF EXISTS `wp_posts`;
#
# Table structure of table `wp_posts`
#
CREATE TABLE `wp_posts` (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`post_author` bigint(20) NOT NULL default '0',
`post_date` datetime NOT NULL default '0000-00-00 00:00:00',
`post_date_gmt` datetime NOT NULL default '0000-00-00 00:00:00',
`post_content` longtext NOT NULL,
`post_title` text NOT NULL,
`post_category` int(4) NOT NULL default '0',
`post_excerpt` text NOT NULL,
`post_status`
enum('publish','draft','private','static','object' ,'attachment','inherit','future')
NOT NULL default 'publish',
`comment_status` enum('open','closed','registered_only') NOT NULL default
'open',
`ping_status` enum('open','closed') NOT NULL default 'open',
`post_password` varchar(20) NOT NULL default '',
`post_name` varchar(200) NOT NULL default '',
`to_ping` text NOT NULL,
`pinged` text NOT NULL,
`post_modified` datetime NOT NULL default '0000-00-00 00:00:00',
`post_modified_gmt` datetime NOT NULL default '0000-00-00 00:00:00',
`post_content_filtered` text NOT NULL,
`post_parent` bigint(20) NOT NULL default '0',
`guid` varchar(255) NOT NULL default '',
`menu_order` int(11) NOT NULL default '0',
`post_type` varchar(20) NOT NULL default 'post',
`post_mime_type` varchar(100) NOT NULL default '',
`comment_count` bigint(20) NOT NULL default '0',
PRIMARY KEY (`ID`),
KEY `post_name` (`post_name`),
KEY `type_status_date` (`post_type`,`post_status`,`post_date`,`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=233 DEFAULT CHARSET=latin1 ;

#

# Data contents of table `wp_posts`
#
INSERT INTO `wp_posts` VALUES (2, 2, '2006-02-11 11:52:32', '2006-02-11
19:52:32', 'p align="center" /p\r\np align="center"font
size="4"strongWelcome to Naperville North Boys Track & Fieldbr
/\r\n/strongemHome of the Huskies!br /\r\n/em/fontfont
size="4"br /\r\n/font/p\r\np align="left"font size="1"The Boys
Track and Field Team provides student athletes an opportunity to feel
good
about themselves and their performances. We focus on PRs or Personal
Records
which indicate improvement as result of committment to the team, its
coaches, and to oneself. The Huskies believe in measuring individual
performance by measuring their teammates accomplishments. In doing so,
student athletes invest in their fellow team members and enhance their
own
ability to achieve PRs. Most of all, we love to compete and
have fun!
/font/p\r\np align="left"The subpages to the right should supply
you
with all the information you will need regarding the details of our
program.
In addition, their are numerous printable PDF forms for your
convience./p\r\np align="left"Thanks for visiting our site.
.........................................






  #3  
Old February 12th, 2009, 10:27 PM posted to microsoft.public.access.gettingstarted
ps56k
external usenet poster
 
Posts: 9
Default loading tables via SQL script

tnx for the reply...
I'm not a Access guy, or a SQL guy -
so basically I have this 1GB text file with the commands & data embedded,
and have no idea - outside of stripping out each text element manually -
how to get the data into an Access file so I have something
that I have a chance of manipulating to get to the html blog data
that was basically stored as blob entries.

SO - given all that -
where or how do I start
maybe it's nothing more than "pointing" Access at the text file
and clicking "do it" - not sure how to do that -

"Arvin Meyer [MVP]" wrote in message
...
You can use similar scripts within VBA code or in a query like:

CREATE TABLE tblContacts
([ContactID] counter,
[LastName] text (30),
[FirstName] text (30),
[FullName] text (60),
[ContactDate] date,
[Notes] memo,
CONSTRAINT [ContactID] PRIMARY KEY ([ContactID]));

CREATE UNIQUE INDEX FullName ON tblContacts (LastName, FirstName);

In VBA, you'd do:

Dim strSQL
strSQL = "CREATE UNIQUE INDEX FullName ON tblContacts (LastName,
FirstName);"
CurrentDB.Excecute strSQL
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"ps56k" wrote in message
...
Is this an embedded SQL script for defining & re-loading the tables ?

If MS Access can support this technique,
and all the SQL commands used are valid for MS Access,
then where and how do I point Access at the script ?
Are there parts missing ?

Just trying to get all the html blob data from the old website into a
place
where we can review and export it back out into new physical web pages.

I have what appears to be a plain text backup file
from Wordpress used on a now closed team website.

The website we used for one of our teams
was not renewed last year, and is gone.

I have all the files, including what appears to be a backup file
of the Wordpress blog used to maintain the website.
A snipet is included below.
How can I use this backup file to load an MS Access database ?
It appears to be a list of SQL commands
with the actual text data embedded within the stream.

I really just want a single table - the one with all the formatted text
blog
entries...
-----


DROP TABLE IF EXISTS `wp_posts`;
#
# Table structure of table `wp_posts`
#
CREATE TABLE `wp_posts` (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`post_author` bigint(20) NOT NULL default '0',
`post_date` datetime NOT NULL default '0000-00-00 00:00:00',
`post_date_gmt` datetime NOT NULL default '0000-00-00 00:00:00',
`post_content` longtext NOT NULL,
`post_title` text NOT NULL,
`post_category` int(4) NOT NULL default '0',
`post_excerpt` text NOT NULL,
`post_status`
enum('publish','draft','private','static','object' ,'attachment','inherit','future')
NOT NULL default 'publish',
`comment_status` enum('open','closed','registered_only') NOT NULL
default
'open',
`ping_status` enum('open','closed') NOT NULL default 'open',
`post_password` varchar(20) NOT NULL default '',
`post_name` varchar(200) NOT NULL default '',
`to_ping` text NOT NULL,
`pinged` text NOT NULL,
`post_modified` datetime NOT NULL default '0000-00-00 00:00:00',
`post_modified_gmt` datetime NOT NULL default '0000-00-00 00:00:00',
`post_content_filtered` text NOT NULL,
`post_parent` bigint(20) NOT NULL default '0',
`guid` varchar(255) NOT NULL default '',
`menu_order` int(11) NOT NULL default '0',
`post_type` varchar(20) NOT NULL default 'post',
`post_mime_type` varchar(100) NOT NULL default '',
`comment_count` bigint(20) NOT NULL default '0',
PRIMARY KEY (`ID`),
KEY `post_name` (`post_name`),
KEY `type_status_date` (`post_type`,`post_status`,`post_date`,`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=233 DEFAULT CHARSET=latin1 ;

#

# Data contents of table `wp_posts`
#
INSERT INTO `wp_posts` VALUES (2, 2, '2006-02-11 11:52:32', '2006-02-11
19:52:32', 'p align="center" /p\r\np align="center"font
size="4"strongWelcome to Naperville North Boys Track & Fieldbr
/\r\n/strongemHome of the Huskies!br /\r\n/em/fontfont
size="4"br /\r\n/font/p\r\np align="left"font size="1"The
Boys
Track and Field Team provides student athletes an opportunity to feel
good
about themselves and their performances. We focus on PRs or Personal
Records
which indicate improvement as result of committment to the team, its
coaches, and to oneself. The Huskies believe in measuring individual
performance by measuring their teammates accomplishments. In doing so,
student athletes invest in their fellow team members and enhance their
own
ability to achieve PRs. Most of all, we love to compete and
have fun!
/font/p\r\np align="left"The subpages to the right should supply
you
with all the information you will need regarding the details of our
program.
In addition, their are numerous printable PDF forms for your
convience./p\r\np align="left"Thanks for visiting our site.
.........................................








  #4  
Old February 13th, 2009, 04:26 AM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default loading tables via SQL script

On Thu, 12 Feb 2009 13:45:51 -0600, "ps56k"
wrote:

Is this an embedded SQL script for defining & re-loading the tables ?


It appears to be SQL/Server T/SQL code.

If MS Access can support this technique,


Unfortunately it cannot...
and all the SQL commands used are valid for MS Access,

.... and they aren't...
then where and how do I point Access at the script ?

.... not easily.
Are there parts missing ?


It's sort of like a big, detailed instruction manual... in Urdu. Great if you
read Urdu but Access doesn't.

It may be worthwhile obtaining a (free!) copy of SQL/Express, running the
script, and then linking to the SQL instance from Access. You could migrate
the data from SQL into an Access database, or (probably better) keep the data
in SQL/Express and just use Access as a frontend.
--

John W. Vinson [MVP]


  #5  
Old February 13th, 2009, 05:33 PM posted to microsoft.public.access.gettingstarted
ps56k
external usenet poster
 
Posts: 9
Default loading tables via SQL script


"John W. Vinson" wrote in message
...
On Thu, 12 Feb 2009 13:45:51 -0600, "ps56k"
wrote:

Is this an embedded SQL script for defining & re-loading the tables ?


It appears to be SQL/Server T/SQL code.

If MS Access can support this technique,


Unfortunately it cannot...
and all the SQL commands used are valid for MS Access,

... and they aren't...
then where and how do I point Access at the script ?

... not easily.
Are there parts missing ?


It's sort of like a big, detailed instruction manual... in Urdu. Great if
you
read Urdu but Access doesn't.

It may be worthwhile obtaining a (free!) copy of SQL/Express, running the
script, and then linking to the SQL instance from Access. You could
migrate
the data from SQL into an Access database, or (probably better) keep the
data
in SQL/Express and just use Access as a frontend.
--

tnx for the reply and pointers..
Since the end goal is to just get the html blog entries from the database,
which are plain text and can easily be seen embedded in the script,
I may just spend the time cutting and pasting the text....
OR - it might be interesting in trying the SQL/express route
and learn a little about that world .



  #6  
Old February 14th, 2009, 04:58 AM posted to microsoft.public.access.gettingstarted
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default loading tables via SQL script

I just had to do something similar. I had CSV files with a million rows in
each. What I did was to change the extension from csv to txt, so they
wouldn't look like Excel files to Access. Then I used the import wizard to
import them, making sure that I checked the datatypes were correct. If the
files are too big to import, you may have to link them, but the resulting
queries will be much slower.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"ps56k" wrote in message
...
tnx for the reply...
I'm not a Access guy, or a SQL guy -
so basically I have this 1GB text file with the commands & data embedded,
and have no idea - outside of stripping out each text element manually -
how to get the data into an Access file so I have something
that I have a chance of manipulating to get to the html blog data
that was basically stored as blob entries.

SO - given all that -
where or how do I start
maybe it's nothing more than "pointing" Access at the text file
and clicking "do it" - not sure how to do that -

"Arvin Meyer [MVP]" wrote in message
...
You can use similar scripts within VBA code or in a query like:

CREATE TABLE tblContacts
([ContactID] counter,
[LastName] text (30),
[FirstName] text (30),
[FullName] text (60),
[ContactDate] date,
[Notes] memo,
CONSTRAINT [ContactID] PRIMARY KEY ([ContactID]));

CREATE UNIQUE INDEX FullName ON tblContacts (LastName, FirstName);

In VBA, you'd do:

Dim strSQL
strSQL = "CREATE UNIQUE INDEX FullName ON tblContacts (LastName,
FirstName);"
CurrentDB.Excecute strSQL
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"ps56k" wrote in message
...
Is this an embedded SQL script for defining & re-loading the tables ?

If MS Access can support this technique,
and all the SQL commands used are valid for MS Access,
then where and how do I point Access at the script ?
Are there parts missing ?

Just trying to get all the html blob data from the old website into a
place
where we can review and export it back out into new physical web pages.

I have what appears to be a plain text backup file
from Wordpress used on a now closed team website.

The website we used for one of our teams
was not renewed last year, and is gone.

I have all the files, including what appears to be a backup file
of the Wordpress blog used to maintain the website.
A snipet is included below.
How can I use this backup file to load an MS Access database ?
It appears to be a list of SQL commands
with the actual text data embedded within the stream.

I really just want a single table - the one with all the formatted text
blog
entries...
-----

DROP TABLE IF EXISTS `wp_posts`;
#
# Table structure of table `wp_posts`
#
CREATE TABLE `wp_posts` (
`ID` bigint(20) unsigned NOT NULL auto_increment,
`post_author` bigint(20) NOT NULL default '0',
`post_date` datetime NOT NULL default '0000-00-00 00:00:00',
`post_date_gmt` datetime NOT NULL default '0000-00-00 00:00:00',
`post_content` longtext NOT NULL,
`post_title` text NOT NULL,
`post_category` int(4) NOT NULL default '0',
`post_excerpt` text NOT NULL,
`post_status`
enum('publish','draft','private','static','object' ,'attachment','inherit','future')
NOT NULL default 'publish',
`comment_status` enum('open','closed','registered_only') NOT NULL
default
'open',
`ping_status` enum('open','closed') NOT NULL default 'open',
`post_password` varchar(20) NOT NULL default '',
`post_name` varchar(200) NOT NULL default '',
`to_ping` text NOT NULL,
`pinged` text NOT NULL,
`post_modified` datetime NOT NULL default '0000-00-00 00:00:00',
`post_modified_gmt` datetime NOT NULL default '0000-00-00 00:00:00',
`post_content_filtered` text NOT NULL,
`post_parent` bigint(20) NOT NULL default '0',
`guid` varchar(255) NOT NULL default '',
`menu_order` int(11) NOT NULL default '0',
`post_type` varchar(20) NOT NULL default 'post',
`post_mime_type` varchar(100) NOT NULL default '',
`comment_count` bigint(20) NOT NULL default '0',
PRIMARY KEY (`ID`),
KEY `post_name` (`post_name`),
KEY `type_status_date` (`post_type`,`post_status`,`post_date`,`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=233 DEFAULT CHARSET=latin1 ;

#

# Data contents of table `wp_posts`
#
INSERT INTO `wp_posts` VALUES (2, 2, '2006-02-11 11:52:32', '2006-02-11
19:52:32', 'p align="center" /p\r\np align="center"font
size="4"strongWelcome to Naperville North Boys Track & Fieldbr
/\r\n/strongemHome of the Huskies!br /\r\n/em/fontfont
size="4"br /\r\n/font/p\r\np align="left"font size="1"The
Boys
Track and Field Team provides student athletes an opportunity to feel
good
about themselves and their performances. We focus on PRs or Personal
Records
which indicate improvement as result of committment to the team, its
coaches, and to oneself. The Huskies believe in measuring individual
performance by measuring their teammates accomplishments. In doing so,
student athletes invest in their fellow team members and enhance their
own
ability to achieve PRs. Most of all, we love to compete and
have fun!
/font/p\r\np align="left"The subpages to the right should supply
you
with all the information you will need regarding the details of our
program.
In addition, their are numerous printable PDF forms for your
convience./p\r\np align="left"Thanks for visiting our site.
.........................................










 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:11 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.