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