Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Inserting records from Excel directly into a SQL database

Hello,

I have very little experience with the more advanced features of Excel and
I'm hoping that some of you can provide me with a little guidance and
suggestions.

What I'd like to do is use macros or VBA (or anything else that might work)
to insert data entries directly into a database (specifically, Interbase).
So, I need to:

1. Populate the columns in my datasheet.
2. For some columns, generate additional information. For example, if I had
three columns for First Name, Last Name, Room number, I would need to
generate the value: First name + Last name + " lives in room " + Room number
+ "." in a fourth column.
3. All four columns of an entry must be entered into a database. This data
may need to be entered into multiple tables so a function call with multiple
insert statements would be necessary.

What's the best approach to do this? Do you have any tips or suggestions on
where I can find more information on how to do this? If you need more
information or clarification, please let me know.

Thanks in advance,

Chris


  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Inserting records from Excel directly into a SQL database

Don't see anything here that would indicate that Excel is necessary. Seems
like you could do this all in your database.

--
Regards,
Tom Ogilvy

"Chris" <c w a n @ n o s p a m - v i g i l . c o m wrote in message
...
Hello,

I have very little experience with the more advanced features of Excel and
I'm hoping that some of you can provide me with a little guidance and
suggestions.

What I'd like to do is use macros or VBA (or anything else that might

work)
to insert data entries directly into a database (specifically, Interbase).
So, I need to:

1. Populate the columns in my datasheet.
2. For some columns, generate additional information. For example, if I

had
three columns for First Name, Last Name, Room number, I would need to
generate the value: First name + Last name + " lives in room " + Room

number
+ "." in a fourth column.
3. All four columns of an entry must be entered into a database. This

data
may need to be entered into multiple tables so a function call with

multiple
insert statements would be necessary.

What's the best approach to do this? Do you have any tips or suggestions

on
where I can find more information on how to do this? If you need more
information or clarification, please let me know.

Thanks in advance,

Chris




  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Inserting records from Excel directly into a SQL database

This is true and other solutions have been considered. I guess I should
have mentioned that this application would be an improvement of an existing
process. For the amount of data that we are processing, Excel is the most
efficient form of data entry. Also, we have other workbook sheets that are
already being generated from this master sheet. It would be best to
automate the steps after the initial data entry rather than reengineer the
entire process using a completely different method. This is the reason why
I'm doing some research down this avenue.


"Tom Ogilvy" wrote in message
...
Don't see anything here that would indicate that Excel is necessary.

Seems
like you could do this all in your database.

--
Regards,
Tom Ogilvy

"Chris" <c w a n @ n o s p a m - v i g i l . c o m wrote in message
...
Hello,

I have very little experience with the more advanced features of Excel

and
I'm hoping that some of you can provide me with a little guidance and
suggestions.

What I'd like to do is use macros or VBA (or anything else that might

work)
to insert data entries directly into a database (specifically,

Interbase).
So, I need to:

1. Populate the columns in my datasheet.
2. For some columns, generate additional information. For example, if I

had
three columns for First Name, Last Name, Room number, I would need to
generate the value: First name + Last name + " lives in room " + Room

number
+ "." in a fourth column.
3. All four columns of an entry must be entered into a database. This

data
may need to be entered into multiple tables so a function call with

multiple
insert statements would be necessary.

What's the best approach to do this? Do you have any tips or

suggestions
on
where I can find more information on how to do this? If you need more
information or clarification, please let me know.

Thanks in advance,

Chris






  #4   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Inserting records from Excel directly into a SQL database

You can use ADO to update your table. I believe Mr. Erlandsen has sample
code for this:

http://www.erlandsendata.no/english/vba/adodao/

You also might do a google group search in this newgroup for posts by
"onedaywhen" who has posted a lot of ADO code.

http://groups.google.com/advanced_group_search?hl=en

http://support.microsoft.com/?kbid=278973
SAMPLE: ExcelADO Demonstrates How to Use ADO to Read and Write Data in Excel
Workbooks

=A2 & " " & B2 & " Lives in Room " & C2

could be placed in the 4th column and filled down.

set rng = Range(cells(2,1),Cells(rows.count,1).End(xlup))
rng.offset(0,3).formula = "=A2 & "" "" & B2 & "" Lives in Room "" & C2"
rng.offset(0,3).formula = rng.offset(0,3).Value

--
Regards,
Tom Ogilvy



"Chris" <c w a n @ n o s p a m - v i g i l . c o m wrote in message
...
This is true and other solutions have been considered. I guess I should
have mentioned that this application would be an improvement of an

existing
process. For the amount of data that we are processing, Excel is the most
efficient form of data entry. Also, we have other workbook sheets that

are
already being generated from this master sheet. It would be best to
automate the steps after the initial data entry rather than reengineer the
entire process using a completely different method. This is the reason

why
I'm doing some research down this avenue.


"Tom Ogilvy" wrote in message
...
Don't see anything here that would indicate that Excel is necessary.

Seems
like you could do this all in your database.

--
Regards,
Tom Ogilvy

"Chris" <c w a n @ n o s p a m - v i g i l . c o m wrote in message
...
Hello,

I have very little experience with the more advanced features of Excel

and
I'm hoping that some of you can provide me with a little guidance and
suggestions.

What I'd like to do is use macros or VBA (or anything else that might

work)
to insert data entries directly into a database (specifically,

Interbase).
So, I need to:

1. Populate the columns in my datasheet.
2. For some columns, generate additional information. For example, if

I
had
three columns for First Name, Last Name, Room number, I would need to
generate the value: First name + Last name + " lives in room " + Room

number
+ "." in a fourth column.
3. All four columns of an entry must be entered into a database. This

data
may need to be entered into multiple tables so a function call with

multiple
insert statements would be necessary.

What's the best approach to do this? Do you have any tips or

suggestions
on
where I can find more information on how to do this? If you need more
information or clarification, please let me know.

Thanks in advance,

Chris








  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Inserting records from Excel directly into a SQL database

This might be a help for getting data to and from Excel and Access: It
includes examples of using variables in SQL queries.
http://www.bygsoftware.com/examples/sql.html

Or you can get there from the "Excel with Access Databases" section on page:
http://www.bygsoftware.com/examples/examples.htm

It demonstrates how to use SQL in Excel's VBA to:

* create a database,
* create a table and add data to it,
* select data from a table,
* delete a table,
* delete a database.

You can also download the demonstration file called "excelsql.zip".

The code is open and commented.
--

Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"



"Tom Ogilvy" wrote in message
...
You can use ADO to update your table. I believe Mr. Erlandsen has sample
code for this:

http://www.erlandsendata.no/english/vba/adodao/

You also might do a google group search in this newgroup for posts by
"onedaywhen" who has posted a lot of ADO code.

http://groups.google.com/advanced_group_search?hl=en

http://support.microsoft.com/?kbid=278973
SAMPLE: ExcelADO Demonstrates How to Use ADO to Read and Write Data in

Excel
Workbooks

=A2 & " " & B2 & " Lives in Room " & C2

could be placed in the 4th column and filled down.

set rng = Range(cells(2,1),Cells(rows.count,1).End(xlup))
rng.offset(0,3).formula = "=A2 & "" "" & B2 & "" Lives in Room "" & C2"
rng.offset(0,3).formula = rng.offset(0,3).Value

--
Regards,
Tom Ogilvy



"Chris" <c w a n @ n o s p a m - v i g i l . c o m wrote in message
...
This is true and other solutions have been considered. I guess I should
have mentioned that this application would be an improvement of an

existing
process. For the amount of data that we are processing, Excel is the

most
efficient form of data entry. Also, we have other workbook sheets that

are
already being generated from this master sheet. It would be best to
automate the steps after the initial data entry rather than reengineer

the
entire process using a completely different method. This is the reason

why
I'm doing some research down this avenue.


"Tom Ogilvy" wrote in message
...
Don't see anything here that would indicate that Excel is necessary.

Seems
like you could do this all in your database.

--
Regards,
Tom Ogilvy

"Chris" <c w a n @ n o s p a m - v i g i l . c o m wrote in message
...
Hello,

I have very little experience with the more advanced features of

Excel
and
I'm hoping that some of you can provide me with a little guidance

and
suggestions.

What I'd like to do is use macros or VBA (or anything else that

might
work)
to insert data entries directly into a database (specifically,

Interbase).
So, I need to:

1. Populate the columns in my datasheet.
2. For some columns, generate additional information. For example,

if
I
had
three columns for First Name, Last Name, Room number, I would need

to
generate the value: First name + Last name + " lives in room " +

Room
number
+ "." in a fourth column.
3. All four columns of an entry must be entered into a database.

This
data
may need to be entered into multiple tables so a function call with
multiple
insert statements would be necessary.

What's the best approach to do this? Do you have any tips or

suggestions
on
where I can find more information on how to do this? If you need

more
information or clarification, please let me know.

Thanks in advance,

Chris












  #6   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Inserting records from Excel directly into a SQL database

Thanks Tom, I'll give it a go and see what I come up with.

Cheers,

Chris


"Tom Ogilvy" wrote in message
...
You can use ADO to update your table. I believe Mr. Erlandsen has sample
code for this:

http://www.erlandsendata.no/english/vba/adodao/

You also might do a google group search in this newgroup for posts by
"onedaywhen" who has posted a lot of ADO code.

http://groups.google.com/advanced_group_search?hl=en

http://support.microsoft.com/?kbid=278973
SAMPLE: ExcelADO Demonstrates How to Use ADO to Read and Write Data in

Excel
Workbooks

=A2 & " " & B2 & " Lives in Room " & C2

could be placed in the 4th column and filled down.

set rng = Range(cells(2,1),Cells(rows.count,1).End(xlup))
rng.offset(0,3).formula = "=A2 & "" "" & B2 & "" Lives in Room "" & C2"
rng.offset(0,3).formula = rng.offset(0,3).Value

--
Regards,
Tom Ogilvy



"Chris" <c w a n @ n o s p a m - v i g i l . c o m wrote in message
...
This is true and other solutions have been considered. I guess I should
have mentioned that this application would be an improvement of an

existing
process. For the amount of data that we are processing, Excel is the

most
efficient form of data entry. Also, we have other workbook sheets that

are
already being generated from this master sheet. It would be best to
automate the steps after the initial data entry rather than reengineer

the
entire process using a completely different method. This is the reason

why
I'm doing some research down this avenue.


"Tom Ogilvy" wrote in message
...
Don't see anything here that would indicate that Excel is necessary.

Seems
like you could do this all in your database.

--
Regards,
Tom Ogilvy

"Chris" <c w a n @ n o s p a m - v i g i l . c o m wrote in message
...
Hello,

I have very little experience with the more advanced features of

Excel
and
I'm hoping that some of you can provide me with a little guidance

and
suggestions.

What I'd like to do is use macros or VBA (or anything else that

might
work)
to insert data entries directly into a database (specifically,

Interbase).
So, I need to:

1. Populate the columns in my datasheet.
2. For some columns, generate additional information. For example,

if
I
had
three columns for First Name, Last Name, Room number, I would need

to
generate the value: First name + Last name + " lives in room " +

Room
number
+ "." in a fourth column.
3. All four columns of an entry must be entered into a database.

This
data
may need to be entered into multiple tables so a function call with
multiple
insert statements would be necessary.

What's the best approach to do this? Do you have any tips or

suggestions
on
where I can find more information on how to do this? If you need

more
information or clarification, please let me know.

Thanks in advance,

Chris










Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to print labels directly from an excel database Printing labels Excel Worksheet Functions 4 August 28th 07 12:11 AM
Extracting Records From Excel Database thorvision Excel Discussion (Misc queries) 5 December 1st 05 06:09 AM
Exporting data directly from Excel to an un-opened Access database using VBA Chris Dunigan Excel Programming 2 November 21st 03 03:16 PM
Adding New Records To Excel Database.. steve Excel Programming 0 August 18th 03 09:11 PM
Adding New Records To Excel Database.. Tom Ogilvy Excel Programming 1 August 18th 03 08:47 PM


All times are GMT +1. The time now is 03:20 AM.

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

About Us

"It's about Microsoft Excel"