Connecting Tech Pros Worldwide Forums | Help | Site Map

Asp using Vb script not working with access database

Newbie
 
Join Date: Apr 2007
Posts: 3
#1: May 16 '07
Hello everyone

i have a problem with my db connection i paste code below please check anyone where i am wrong its very urgent please any one help me!!!!!
and i am working offline using local iis server just check

Thanks
Ravi kale


<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/ravi.asp" -->
<%
Dim raj
Dim raj_numRows
'Dim recordset

Set raj = Server.CreateObject("ADODB.Recordset")
raj.Activeconnection = MM_ravi_STRING
raj.Source = "SELECT * FROM employee"
raj.CursorType = 0
raj.CursorLocation = 2
raj.LockType = 1
raj.Open()
raj_numRows = 0
%>

<script language="VBScript" type="text/VBScript">
set.cnn = Server.CreateObject("ADODB.Connection")
open.connection
cnn.open("Driver={MicrosoftAccessDriver(*.mdb)};DB Q=D:\trupti.mdb;Uid=sa;Pwd=sa;")
"Driver = {MicrosoftAccessDriver(*.mdb)};DBQ=D:\trupti.mdb;U id=sa;Pwd=sa;"
open.recordset
set rs = server.CreateObject("ADODB.Recordset")
strSQL= "select * from employee"
rs.open strSQL,cnn,3,2
insert into employee('First_name','Last_name','Telephone','Ema il','Comment')
values("&txtfirst_name.txt&","&txtlast_name.txt&", "&txttelephone.number&","&txtEmail.memo&","&txtCom ment.txt&")
if NOT rs.eof Then
while NOT rs.EOF
rs.movenext
wend
end if

</script>
<html>
<head>
<Body>
<FORM action="test.asp"FORM METHOD="post" name=test.asp Actionvar=add">

<p>First_name
<INPUT TYPE="text" NAME="First_name">
<BR>
Last_name
<INPUT TYPE="text" NAME="Last_name">
<BR>
Telephone
<INPUT TYPE="text" NAME="Telephone">
<BR>
Email
<INPUT TYPE="text" NAME="Email">
<BR>
Comment
<INPUT TYPE="text" NAME="Comment">
<BR>
<INPUT name="add" TYPE="submit" id="insert" VALUE="Insert">
</p>
</FORM>
</html>
</head>
</Body>

<%
raj.Close()
Set raj = Nothing
%>

Newbie
 
Join Date: May 2007
Posts: 1
#2: May 16 '07

re: Asp using Vb script not working with access database


I have found answers to almost every connection string problem I have ever had at http://www.connectionstrings.com/
Reply