DataAdapter Insert data into a query

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul

    DataAdapter Insert data into a query

    I have the query "SELECT * FROM [User Log] RIGHT JOIN VisiterInfo ON [User
    Log].[Visiter ID]=VisiterInfo.[Visiter ID]" which I use to select data from
    two tables to display on screen. I use an Access file with an OleDb
    connection.

    I need to be able to insert rows into this query so that both tables are
    updated but I cant figure it out I have try tried the sql below plus many
    other alterations of it but cant get it to work. Does anyone have any
    Ideas?

    "INSERT INTO SELECT * FROM [User Log] RIGHT JOIN VisiterInfo ON [User
    Log].[Visiter ID]=VisiterInfo.[Visiter ID] ([VisiterInfo.Vis iter ID], [User
    Log.Visiter ID], [Visiter Name], [Visit Number], [Referer], [IP], [Date],
    [Time], [Entry Page]) VALUES (@VisID, @UVisID, @VisName, @VisNum, @Ref, @IP,
    @Date, @Time, @EntryPage)"


Working...