PDA

View Full Version : use ASP to connect to access database



sandra
11-28-2007, 07:14 AM
Hi, i need ASP code to connect to Database (Access). could any one help me in this issue?
before i use this code bust unfortunately in didn't work?

<%
dim cmd ,rs

set cmd = Server.CreateObject ("ADODB.Command")
cmd.ActiveConnection = Session("cnStr_mahsoolut")
cmd.CommandText ="select Turix from tblTurix"
' order by fieldsName DESC"
set rs = cmd.Execute()


function backStr(strVar)
dim strTemp
'------------------------------------------------------
' backStr = StrReverse(strVal) [Reverse String Method]
'------------------------------------------------------
'for i=len(strVar) to 1 step-1
' strTemp = strTemp + mid(strVar,i,1) [ or ]
'next
'backStr=strTemp
'------------------------------------------------------
' Exp. strVar=1381/10/14 [String Sample]
'------------------------------------------------------
strTemp = right(strVar,2) + "/" + mid(strVar,6,2) + "/" + left(strVar,4)
backStr=strTemp
end function




' ------------------------ Subroutin Format -------------
' sub testSub
' . . . .
' end sub
'
' . .... response.write call testSub

%>