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

access table and vb.net

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.