473,385 Members | 1,934 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

access table and vb.net

I have a access database with a table called Transactions. I want to copy
select records from the table Transactions to a seperate table within the
database called Month. I think the following is suppose to work
assuming I have a valid conncetion...but of course it doesnt... I can run
the select statement seperate without a problem, and the insert statement
seperate without a problem.

any help, idea's or suggestions will def make my day

sqlString="insert into month f1,f2 ( select f1,f2 from Transactions where
month = 'April')"

cmd.ExecuteNonQuery()

terry



Nov 20 '05 #1
2 954
Hi Terry,

This can't be all the code. How do you define 'cmd'? Let's see it all;
also, explain any errors you may have received.

HTH,

Bernie Yaeger

"NewbieTerry" <tj****@noway.homer.com> wrote in message
news:O9**************@TK2MSFTNGP09.phx.gbl...
I have a access database with a table called Transactions. I want to copy
select records from the table Transactions to a seperate table within the
database called Month. I think the following is suppose to work
assuming I have a valid conncetion...but of course it doesnt... I can run
the select statement seperate without a problem, and the insert statement
seperate without a problem.

any help, idea's or suggestions will def make my day

sqlString="insert into month f1,f2 ( select f1,f2 from Transactions where
month = 'April')"

cmd.ExecuteNonQuery()

terry


Nov 20 '05 #2
If f1 and f2 are the only columns in month then the following insert
statement should work.
insert into month select f1,f2 from transactions
If there are other columns in month then either the other columns must be
able to handle nulls or add the appropriate constants in the select
statement.

"NewbieTerry" <tj****@noway.homer.com> wrote in message
news:O9**************@TK2MSFTNGP09.phx.gbl...
I have a access database with a table called Transactions. I want to copy
select records from the table Transactions to a seperate table within the
database called Month. I think the following is suppose to work
assuming I have a valid conncetion...but of course it doesnt... I can run
the select statement seperate without a problem, and the insert statement
seperate without a problem.

any help, idea's or suggestions will def make my day

sqlString="insert into month f1,f2 ( select f1,f2 from Transactions where
month = 'April')"

cmd.ExecuteNonQuery()

terry


Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
2
by: Daniel | last post by:
I use an Access database to basically take data exports, import them, manipulate the data, and then turn them into exportable reports. I do this using numerous macros, and queries to get the data...
1
by: Andrew Arace | last post by:
I scoured the groups for some hands on code to perform the menial task of exporting table data from an Access 2000 database to Oracle database (in this case, it was oracle 8i but i'm assuming this...
4
by: bhbgroup | last post by:
I have a query on one large table. I only add one condition, i.e. a date (the SQL reads like 'where date > parameterdate'. This query is rather quick if 'parameterdate' is either explicitly...
5
by: premmehrotra | last post by:
I am using Microsoft Access 2000 and Oracle 9.2.0.5 on Windows 2000. When I export a table from Access to Oracle using ODBC I get error: ORA 972 identifier too long I think the error is because...
7
by: Ruben Baumann | last post by:
Just wondered if anyone has had occasion to use, or does use, FileMaker, or Raining Data's Omnis, or Alpha5's software, and how they compare with Access? Ruben
2
by: meyvn77 | last post by:
Background: I'm new at SQL Server (no experience, zip, nada) but getting pretty good with developing applications in Access(VBA) and in VB using ADO.... Currently I use access to and GIS...
24
by: Bob Alston | last post by:
Most of my Access database implementations have been fairly small in terms of data volume and number of concurrent users. So far I haven't had performance issues to worry about. <knock on wood> ...
52
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server...
10
by: Les Desser | last post by:
In article <fcebdacd-2bd8-4d07-93a8-8b69d3452f3e@s50g2000hsb.googlegroups.com>, The Frog <Mr.Frog.to.you@googlemail.comMon, 14 Apr 2008 00:45:10 writes Thank you for that. It was very...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.