Incert record into Access

O

Otuatail

Can anyone tell me please the way to insert into Access.
I have got some old SQL server code which I have tried to use
Thanks Paul

-------------------------------
<%@ Language=VBScript %>
<!--#include file="dates.inc" -->
<%
Set connection = Server.CreateObject("ADODB.Connection")
Set rsWeeks = Server.CreateObject("ADODB.Recordset")
dsn = "DSN=SampleDB2"
connection.Open dsn

Access = Request("Access")
User = Request("User")
SelWk = Request("SelectedWeek")
FullDay = GetWeek(SelWk)
FullDay = FormatDateTime(FullDay,1)
sMonth = DatePart("m",FullDay)
// Response.Write "Access = " & Access & " User = " & User & " " & "<br>"

sqlAddWeek = "INSERT INTO Weeks Values('" & FullDay & "'," & cint(sMonth) & ","
& SelWk & ")"
sqlLog = "INSERT INTO Log Values(" & cint(User) & ",'" & Now &
"','Add','Weeks','" & sqlAddWeek & "')"

OpenRecordset sqlAddWeek,connection,rsWeeks
%>
Error = Type mismatch: 'OpenRecordset'

sqlAddWeek = INSERT INTO Weeks Values('01 November 2003',11,44)
 
B

brucie

Can anyone tell me please the way to insert into Access.

microsoft.public.access
microsoft.public.access.activexcontrol
microsoft.public.access.adp.sqlserver
microsoft.public.access.commandbarsui
microsoft.public.access.conversion
microsoft.public.access.dataaccess.pages
microsoft.public.access.developers.toolkitode
microsoft.public.access.devtoolkits
microsoft.public.access.externaldata
microsoft.public.access.forms
microsoft.public.access.formscoding
microsoft.public.access.gettingstarted
microsoft.public.access.internet
microsoft.public.access.interopoledde
microsoft.public.access.macros
microsoft.public.access.modulesdaovba
microsoft.public.access.modulesdaovba.ado
microsoft.public.access.multiuser
microsoft.public.access.odbcclientsvr
microsoft.public.access.queries
microsoft.public.access.replication
microsoft.public.access.reports
microsoft.public.access.security
microsoft.public.access.setupconfig
microsoft.public.access.tablesdbdesign
 
H

Hywel Jenkins

Can anyone tell me please the way to insert into Access.
I have got some old SQL server code which I have tried to use
Thanks Paul

OpenRecordset sqlAddWeek,connection,rsWeeks

Is the above line correct? What does "OpenRecordset" do? Should it be
attached to an object or is it your own custom function?
 

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

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top