Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
isheikh
Starting Member
25 Posts |
Posted - 2004-02-14 : 11:14:04
|
Hi,I am using MSDE. When I have the following code it works fine.Dim objConn, objRSSet objConn=Server.CreateObject("ADODB.Connection") Set objRS = server.CreateObject("ADODB.Recordset") objConn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=AStrongSAPwd;Initial Catalog=bothamSQL;Data Source=irfan-ne8ldmk8y;Initial File Name=D:\Program Files\Microsoft SQL Server\MSSQL\Data\bothamSQL.mdf" objRS.Open "table1",objConn,adOpenForwardOnly,adLockReadOnly,adCmdTable While not objRS.EOFresponse.write objRS("id").Value & "<br>"objRS.MoveNextWendBut when I put select statement instead of only table name at objRS.open, like,objRS.Open "select * from table1",objConn,adOpenForwardOnly,adLockReadOnly,adCmdTableI get this errorTechnical Information (for support personnel)Error Type:Microsoft OLE DB Provider for SQL Server (0x80040E14)Incorrect syntax near the keyword 'select'.I was told you can put the select statement there, anyone know s why I am geting this error |
|
|
|
|