By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,472 Members | 2,195 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,472 IT Pros & Developers. It's quick & easy.

Dump file to access table

P: n/a
Hi All,

I have a mysql dump file... something like.

__________________________________________________
CREATE TABLE nation (
ip int(11) unsigned NOT NULL default '0',
country char(2) NOT NULL default '',
KEY ip (ip)
);

INSERT INTO nation (ip, country) VALUES(0, 'us');
INSERT INTO nation (ip, country) VALUES(700448768, 'za');
INSERT INTO nation (ip, country) VALUES(701464576, 'mu');
INSERT INTO nation (ip, country) VALUES(701472768, 'tg');
__________________________________________________ __

Now i want to run this dump on access and have corresponding table
there..

Is there a wat to do this.
If not, then what exactly can be done to transfer the table.
I can see myself writing a code for it... but isn't there some
automatic(inbuilt) process ?

May 19 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a
No. At least not as far as I know, but I do feel more
ignorant with each day that passes.

If the dump file isn't to big you could try copy and pasting
it into Access query designers' SQL view and see what
happens.

--
Nick Coe (UK)
http://www.alphacos.co.uk/
AccHelp is now free/donateware

In
news:11**********************@g10g2000cwb.googlegr oups.com,
Shivam typed:
Hi All,

I have a mysql dump file... something like.

__________________________________________________
CREATE TABLE nation (
ip int(11) unsigned NOT NULL default '0',
country char(2) NOT NULL default '',
KEY ip (ip)
);

INSERT INTO nation (ip, country) VALUES(0, 'us');
INSERT INTO nation (ip, country) VALUES(700448768, 'za');
INSERT INTO nation (ip, country) VALUES(701464576, 'mu');
INSERT INTO nation (ip, country) VALUES(701472768, 'tg');
__________________________________________________ __

Now i want to run this dump on access and have
corresponding
table there..

Is there a wat to do this.
If not, then what exactly can be done to transfer the
table.
I can see myself writing a code for it... but isn't there
some
automatic(inbuilt) process ?

May 19 '06 #2

P: n/a
"Shivam" <sh**************@gmail.com> wrote in
news:11**********************@g10g2000cwb.googlegr oups.com:
Hi All,

I have a mysql dump file... something like.

__________________________________________________
CREATE TABLE nation (
ip int(11) unsigned NOT NULL default '0',
country char(2) NOT NULL default '',
KEY ip (ip)
);

INSERT INTO nation (ip, country) VALUES(0, 'us');
INSERT INTO nation (ip, country) VALUES(700448768, 'za');
INSERT INTO nation (ip, country) VALUES(701464576, 'mu');
INSERT INTO nation (ip, country) VALUES(701472768, 'tg');
__________________________________________________ __

Now i want to run this dump on access and have corresponding
table there..

Is there a wat to do this.
If not, then what exactly can be done to transfer the table.
I can see myself writing a code for it... but isn't there some
automatic(inbuilt) process ?

Import the file into a one field access table.
write a sub that reads a record from this table, and stuffs the
contents into a variable. (strsql for example)

If the last character is a semicolon, execute the sql statement
docmd.runsql strsql.

otherwise, concatenate the next row of the table into the
variable.
strsql = strsql & nextline

loop through the recordset
--
Bob Quintal

PA is y I've altered my email address.
May 19 '06 #3

P: n/a
Good intuition Bob,

....the only thing is that perhaps it needs some slight refinements to
work in some cases.
For instance, if you have the command:
INSERT INTO nation (id, sentence) VALUES(1, "Keywords: Access;
Programming; Log");

split as:

INSERT INTO nation (id, sentence) VALUES(1, "Keywords: Access;

Programming; Log");

Would it be easy to perfection your logic to deal with that?

-tom

Bob Quintal ha scritto:
"Shivam" <sh**************@gmail.com> wrote in
news:11**********************@g10g2000cwb.googlegr oups.com:
Hi All,

I have a mysql dump file... something like.

__________________________________________________
CREATE TABLE nation (
ip int(11) unsigned NOT NULL default '0',
country char(2) NOT NULL default '',
KEY ip (ip)
);

INSERT INTO nation (ip, country) VALUES(0, 'us');
INSERT INTO nation (ip, country) VALUES(700448768, 'za');
INSERT INTO nation (ip, country) VALUES(701464576, 'mu');
INSERT INTO nation (ip, country) VALUES(701472768, 'tg');
__________________________________________________ __

Now i want to run this dump on access and have corresponding
table there..

Is there a wat to do this.
If not, then what exactly can be done to transfer the table.
I can see myself writing a code for it... but isn't there some
automatic(inbuilt) process ?

Import the file into a one field access table.
write a sub that reads a record from this table, and stuffs the
contents into a variable. (strsql for example)

If the last character is a semicolon, execute the sql statement
docmd.runsql strsql.

otherwise, concatenate the next row of the table into the
variable.
strsql = strsql & nextline

loop through the recordset
--
Bob Quintal

PA is y I've altered my email address.


May 19 '06 #4

P: n/a
to**************@uniroma1.it wrote in
news:11*********************@j73g2000cwa.googlegro ups.com:

Good intuition Bob,

...the only thing is that perhaps it needs some slight
refinements to work in some cases.
For instance, if you have the command:
INSERT INTO nation (id, sentence) VALUES(1, "Keywords: Access;
Programming; Log");

split as:

INSERT INTO nation (id, sentence) VALUES(1, "Keywords: Access;

Programming; Log");

Would it be easy to perfection your logic to deal with that?

-tom
I'm sure a good programmer could write enough tests to make it
automatically resolve such issues, Sometimes, it may be quicker
to find and manually fix the data than write and debug code.


Bob Quintal ha scritto:
"Shivam" <sh**************@gmail.com> wrote in
news:11**********************@g10g2000cwb.googlegr oups.com:
> Hi All,
>
> I have a mysql dump file... something like.
>
> __________________________________________________
> CREATE TABLE nation (
> ip int(11) unsigned NOT NULL default '0',
> country char(2) NOT NULL default '',
> KEY ip (ip)
> );
>
> INSERT INTO nation (ip, country) VALUES(0, 'us');
> INSERT INTO nation (ip, country) VALUES(700448768, 'za');
> INSERT INTO nation (ip, country) VALUES(701464576, 'mu');
> INSERT INTO nation (ip, country) VALUES(701472768, 'tg');
> __________________________________________________ __
>
> Now i want to run this dump on access and have
> corresponding table there..
>
> Is there a wat to do this.
> If not, then what exactly can be done to transfer the
> table. I can see myself writing a code for it... but isn't
> there some automatic(inbuilt) process ?
>

Import the file into a one field access table.
write a sub that reads a record from this table, and stuffs
the contents into a variable. (strsql for example)

If the last character is a semicolon, execute the sql
statement docmd.runsql strsql.

otherwise, concatenate the next row of the table into the
variable.
strsql = strsql & nextline

loop through the recordset
--
Bob Quintal

PA is y I've altered my email address.



--
Bob Quintal

PA is y I've altered my email address.
May 20 '06 #5

P: n/a
Right, it's true! :)

-tom

Bob Quintal ha scritto:
to**************@uniroma1.it wrote in
news:11*********************@j73g2000cwa.googlegro ups.com:

Good intuition Bob,

...the only thing is that perhaps it needs some slight
refinements to work in some cases.
For instance, if you have the command:
INSERT INTO nation (id, sentence) VALUES(1, "Keywords: Access;
Programming; Log");

split as:

INSERT INTO nation (id, sentence) VALUES(1, "Keywords: Access;

Programming; Log");

Would it be easy to perfection your logic to deal with that?

-tom


I'm sure a good programmer could write enough tests to make it
automatically resolve such issues, Sometimes, it may be quicker
to find and manually fix the data than write and debug code.


Bob Quintal ha scritto:
"Shivam" <sh**************@gmail.com> wrote in
news:11**********************@g10g2000cwb.googlegr oups.com:

> Hi All,
>
> I have a mysql dump file... something like.
>
> __________________________________________________
> CREATE TABLE nation (
> ip int(11) unsigned NOT NULL default '0',
> country char(2) NOT NULL default '',
> KEY ip (ip)
> );
>
> INSERT INTO nation (ip, country) VALUES(0, 'us');
> INSERT INTO nation (ip, country) VALUES(700448768, 'za');
> INSERT INTO nation (ip, country) VALUES(701464576, 'mu');
> INSERT INTO nation (ip, country) VALUES(701472768, 'tg');
> __________________________________________________ __
>
> Now i want to run this dump on access and have
> corresponding table there..
>
> Is there a wat to do this.
> If not, then what exactly can be done to transfer the
> table. I can see myself writing a code for it... but isn't
> there some automatic(inbuilt) process ?
>
Import the file into a one field access table.
write a sub that reads a record from this table, and stuffs
the contents into a variable. (strsql for example)

If the last character is a semicolon, execute the sql
statement docmd.runsql strsql.

otherwise, concatenate the next row of the table into the
variable.
strsql = strsql & nextline

loop through the recordset
--
Bob Quintal

PA is y I've altered my email address.



--
Bob Quintal

PA is y I've altered my email address.


May 20 '06 #6

P: n/a
rkc
to**************@uniroma1.it wrote:
Good intuition Bob,

...the only thing is that perhaps it needs some slight refinements to
work in some cases.
For instance, if you have the command:
INSERT INTO nation (id, sentence) VALUES(1, "Keywords: Access;
Programming; Log");

split as:

INSERT INTO nation (id, sentence) VALUES(1, "Keywords: Access;

Programming; Log");

Would it be easy to perfection your logic to deal with that?

-tom

Bob Quintal ha scritto:

"Shivam" <sh**************@gmail.com> wrote in
news:11**********************@g10g2000cwb.google groups.com:

Hi All,

I have a mysql dump file... something like.

_______________________________________________ ___
CREATE TABLE nation (
ip int(11) unsigned NOT NULL default '0',
country char(2) NOT NULL default '',
KEY ip (ip)
);

INSERT INTO nation (ip, country) VALUES(0, 'us');
INSERT INTO nation (ip, country) VALUES(700448768, 'za');
INSERT INTO nation (ip, country) VALUES(701464576, 'mu');
INSERT INTO nation (ip, country) VALUES(701472768, 'tg');
_______________________________________________ _____

Now i want to run this dump on access and have corresponding
table there..

Is there a wat to do this.
If not, then what exactly can be done to transfer the table.
I can see myself writing a code for it... but isn't there some
automatic(inbuilt) process ?


Import the file into a one field access table.
write a sub that reads a record from this table, and stuffs the
contents into a variable. (strsql for example)

If the last character is a semicolon, execute the sql statement
docmd.runsql strsql.

otherwise, concatenate the next row of the table into the
variable.
strsql = strsql & nextline

loop through the recordset
--
Bob Quintal

PA is y I've altered my email address.


Load the text file into one string variable and Split on ");"


May 20 '06 #7

P: n/a
rkc <rk*@rochester.yabba.dabba.do.rr.bomb> wrote in
news:bZ****************@twister.nyroc.rr.com:
"Shivam" <sh**************@gmail.com> wrote in
news:11**********************@g10g2000cwb.googl egroups.com:
Hi All,

I have a mysql dump file... something like.

______________________________________________ ____
CREATE TABLE nation (
ip int(11) unsigned NOT NULL default '0',
country char(2) NOT NULL default '',
KEY ip (ip)
);

INSERT INTO nation (ip, country) VALUES(0, 'us');
INSERT INTO nation (ip, country) VALUES(700448768, 'za');
INSERT INTO nation (ip, country) VALUES(701464576, 'mu');
INSERT INTO nation (ip, country) VALUES(701472768, 'tg');
______________________________________________ ______


Load the text file into one string variable and Split on ");"

I've seen some of these dump files exceed 10Megabytes, I would
not want to get tied up in that much string.

--
Bob Quintal

PA is y I've altered my email address.
May 20 '06 #8

P: n/a
rkc
Bob Quintal wrote:
rkc <rk*@rochester.yabba.dabba.do.rr.bomb> wrote in
news:bZ****************@twister.nyroc.rr.com:


Load the text file into one string variable and Split on ");"


I've seen some of these dump files exceed 10Megabytes, I would
not want to get tied up in that much string.


I think a little common sense would provide a solution to that.
May 20 '06 #9

P: n/a
Hi Shivam,

If you send me the dump text file (zipped), I can do it for you
(clearly for free) and send you back the Access file.

-t

Shivam ha scritto:
Hi All,

I have a mysql dump file... something like.

__________________________________________________
CREATE TABLE nation (
ip int(11) unsigned NOT NULL default '0',
country char(2) NOT NULL default '',
KEY ip (ip)
);

INSERT INTO nation (ip, country) VALUES(0, 'us');
INSERT INTO nation (ip, country) VALUES(700448768, 'za');
INSERT INTO nation (ip, country) VALUES(701464576, 'mu');
INSERT INTO nation (ip, country) VALUES(701472768, 'tg');
__________________________________________________ __

Now i want to run this dump on access and have corresponding table
there..

Is there a wat to do this.
If not, then what exactly can be done to transfer the table.
I can see myself writing a code for it... but isn't there some
automatic(inbuilt) process ?


May 22 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.