[ASP] Fehlermeldung beim ausführen eines SQL Abfrage...
Marco Velo
activeserverpages at glengamoi.com
Mon, 29 Nov 2004 19:02:50 +0100
This is a multi-part message in MIME format.
------_=_NextPart_001_01C4D63D.A3E5A00D
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hallo
Ich bekomme beim ausführen einer Abfrage (DB Befindet auf sql 2000 SV) =
folg. Fehlermeldung:
Microsoft OLE DB Provider for SQL Server- Fehler '80040e14'
Falsche Syntax in der Nähe des AND-Schlüsselwortes.
/hofdesign/login.asp, line 103
So sieht mein Code aus:
Private Sub Schritt2()
Dim rs, Conn, strSQL, LoginOK
set rs = Server.CreateObject("ADODB.Recordset")
Set Conn = CreateObject("ADODB.Connection")
Conn.open = "Provider=SQLOLEDB.1; " &_
"Data Source=Tritis; Initial Catalog=Hof_Design; User id=xxxxx; =
Password=xxxxx"
strSQL = "Select * from Benutzer Where Kd_Nr="
strSQL = strSQL & user_id & " AND Password=" & Password & ";"
rs.Open strSQL, Conn, 0, 1
LoginOK = rs.EOF 'Wenn EOF dann Benutzer nicht vorhanden
rs.Close
set rs = nothing
Variablen user_id und Password habe ich deklariert. Werten werden mit =
Request Methode vom Formular zugewiesen....
DANKE
Gruss
Marco
------_=_NextPart_001_01C4D63D.A3E5A00D
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML =
DIR=ltr><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; =
charset=iso-8859-1"></HEAD><BODY><DIV><FONT face='Arial' =
color=#000000 size=2>Hallo</FONT></DIV>=0A=
<DIV><FONT face=Arial color=#000000 size=2>Ich bekomme beim =
ausführen einer =0A=
Abfrage (DB Befindet auf sql 2000 SV) folg. Fehlermeldung:</FONT></DIV>=0A=
<DIV><FONT face=Arial color=#000000 size=2> <BR>Microsoft OLE =
DB Provider =0A=
for SQL Server- Fehler '80040e14' </FONT></DIV>=0A=
<DIV><FONT face=Arial color=#000000 size=2>Falsche Syntax in der =
Nähe des =0A=
AND-Schlüsselwortes. </FONT></DIV>=0A=
<DIV><FONT face=Arial color=#000000 size=2>/hofdesign/login.asp, =
line 103 =0A=
</FONT></DIV>=0A=
<DIV><FONT face=Arial size=2></FONT> </DIV>=0A=
<DIV><FONT face=Arial size=2>So sieht mein Code aus:</FONT></DIV>=0A=
<DIV><FONT face=Arial size=2></FONT> </DIV>=0A=
<DIV><FONT face=Arial size=2>Private Sub Schritt2()<BR> Dim =
rs, Conn, =0A=
strSQL, LoginOK<BR> set rs = =0A=
Server.CreateObject("ADODB.Recordset")</FONT></DIV>=0A=
<DIV><FONT face=Arial size=2> Set Conn = =0A=
CreateObject("ADODB.Connection")<BR> Conn.open = =
"Provider=SQLOLEDB.1; " =0A=
&_<BR> "Data Source=Tritis; Initial Catalog=Hof_Design; =
User id=xxxxx; =0A=
Password=xxxxx"<BR> <BR> strSQL = "Select * from =
Benutzer Where =0A=
Kd_Nr="<BR> strSQL = strSQL & user_id & " AND =
Password=" & =0A=
Password & ";"<BR> <BR> rs.Open strSQL, Conn, 0, =
1<BR> =0A=
LoginOK = rs.EOF 'Wenn EOF dann Benutzer nicht vorhanden</FONT></DIV>=0A=
<DIV><FONT face=Arial size=2> rs.Close<BR> set rs = =0A=
nothing</FONT></DIV>=0A=
<DIV><FONT face=Arial><FONT size=2></FONT></FONT> </DIV>=0A=
<DIV><FONT face=Arial><FONT size=2></FONT></FONT> </DIV>=0A=
<DIV><FONT face=Arial><FONT size=2>Variablen user_id und Password =
habe ich =0A=
deklariert. Werten werden mit Request Methode vom Formular =0A=
zugewiesen....</FONT></FONT></DIV>=0A=
<DIV><FONT face=Arial><FONT size=2></FONT></FONT> </DIV>=0A=
<DIV><FONT face=Arial><FONT size=2></FONT></FONT> </DIV>=0A=
<DIV><FONT face=Arial><FONT size=2>DANKE</FONT></FONT></DIV>=0A=
<DIV><FONT face=Arial><FONT size=2></FONT></FONT> </DIV>=0A=
<DIV><FONT face=Arial>Gruss</FONT></DIV>=0A=
<DIV><FONT face=Arial>Marco</DIV></FONT></BODY></HTML>
------_=_NextPart_001_01C4D63D.A3E5A00D--