access table and vb.net

  • Thread starter Thread starter NewbieTerry
  • Start date Start date
N

NewbieTerry

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
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top