数据库实现参数查询时的错误
加入了parameterrow组件后
定义了两个参数min,max;
itemeditor设成querydataset1;
querydataset1里的sql语句设置成
SELECT asset.asset_id,asset.asset_type,asset.project_id FROM company.dbo.asset where asset.asset_id<=:max and asset.asset_id>=:min
但就是提示出错
请教出错原因
谢谢
问题点数:0、回复次数:8Top
1 楼darkattack(居士)回复于 2005-04-04 11:12:15 得分 0
什么错?Top
2 楼winnindai(last cigaret)回复于 2005-04-04 12:01:56 得分 0
执行语句出错呀Top
3 楼zjjjacky(kiky)回复于 2005-04-04 12:22:29 得分 0
是什么数据库?Top
4 楼winnindai(last cigaret)回复于 2005-04-04 13:25:35 得分 0
数据库是MS SQLserverTop
5 楼darkattack(居士)回复于 2005-04-04 13:38:19 得分 0
出错信息发出来Top
6 楼winnindai(last cigaret)回复于 2005-04-04 14:12:06 得分 0
以下是出错信息
Execution of query failedTop
7 楼winnindai(last cigaret)回复于 2005-04-04 14:13:14 得分 0
See com.borland.dx.dataset.DataSetException error code: BASE+62
com.borland.dx.dataset.DataSetException: Execution of query failed.
at com.borland.dx.dataset.DataSetException.a(Unknown Source)
at com.borland.dx.dataset.DataSetException.queryFailed(Unknown Source)
at com.borland.dx.sql.dataset.QueryProvider.a(Unknown Source)
at com.borland.dx.sql.dataset.JdbcProvider.provideData(Unknown Source)
at com.borland.dx.dataset.StorageDataSet.a(Unknown Source)
at com.borland.dx.dataset.DataSet.a(Unknown Source)
at com.borland.dx.dataset.DataSet.open(Unknown Source)
at com.borland.dbswing.JdbTable.bindDataSet(JdbTable.java:2751)
at com.borland.dbswing.JdbTable.addNotify(JdbTable.java:2735)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at javax.swing.JRootPane.addNotify(JRootPane.java:673)
at java.awt.Container.addImpl(Container.java:658)
at javax.swing.JViewport.setView(JViewport.java:945)
at javax.swing.JViewport.addImpl(JViewport.java:307)
at java.awt.Container.add(Container.java:307)
at com.borland.jbuilder.designer.DesignerViewer.activateDesignViewImpl(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.activateDesignView(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.edit(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.openImpl(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.open(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.changeUrl(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.viewerActivated(Unknown Source)
at com.borland.jbuilder.designer.i.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
Chained exception:
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]第 1 行: ':' 附近有语法错误。
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6879)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7036)
at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:3104)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedStatement.java:214)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeQuery(JdbcOdbcPreparedStatement.java:89)
at com.borland.dx.sql.dataset.o.f(Unknown Source)
at com.borland.dx.sql.dataset.QueryProvider.e(Unknown Source)
at com.borland.dx.sql.dataset.JdbcProvider.provideData(Unknown Source)
at com.borland.dx.dataset.StorageDataSet.a(Unknown Source)
at com.borland.dx.dataset.DataSet.a(Unknown Source)
at com.borland.dx.dataset.DataSet.open(Unknown Source)
at com.borland.dbswing.JdbTable.bindDataSet(JdbTable.java:2751)
at com.borland.dbswing.JdbTable.addNotify(JdbTable.java:2735)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at javax.swing.JRootPane.addNotify(JRootPane.java:673)
at java.awt.Container.addImpl(Container.java:658)
at javax.swing.JViewport.setView(JViewport.java:945)
at javax.swing.JViewport.addImpl(JViewport.java:307)
at java.awt.Container.add(Container.java:307)
at com.borland.jbuilder.designer.DesignerViewer.activateDesignViewImpl(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.activateDesignView(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.edit(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.openImpl(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.open(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.changeUrl(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.viewerActivated(Unknown Source)
at com.borland.jbuilder.designer.i.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
Top
8 楼winnindai(last cigaret)回复于 2005-04-04 14:16:34 得分 0
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]第 1 行: ':' 附近有语法错误。
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6879)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7036)
at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:3104)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedStatement.java:214)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeQuery(JdbcOdbcPreparedStatement.java:89)
at com.borland.dx.sql.dataset.o.f(Unknown Source)
at com.borland.dx.sql.dataset.QueryProvider.e(Unknown Source)
at com.borland.dx.sql.dataset.JdbcProvider.provideData(Unknown Source)
at com.borland.dx.dataset.StorageDataSet.a(Unknown Source)
at com.borland.dx.dataset.DataSet.a(Unknown Source)
at com.borland.dx.dataset.DataSet.open(Unknown Source)
at com.borland.dbswing.JdbTable.bindDataSet(JdbTable.java:2751)
at com.borland.dbswing.JdbTable.addNotify(JdbTable.java:2735)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at java.awt.Container.addNotify(Container.java:2045)
at javax.swing.JComponent.addNotify(JComponent.java:4283)
at javax.swing.JRootPane.addNotify(JRootPane.java:673)
at java.awt.Container.addImpl(Container.java:658)
at javax.swing.JViewport.setView(JViewport.java:945)
at javax.swing.JViewport.addImpl(JViewport.java:307)
at java.awt.Container.add(Container.java:307)
at com.borland.jbuilder.designer.DesignerViewer.activateDesignViewImpl(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.activateDesignView(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.edit(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.openImpl(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.open(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.changeUrl(Unknown Source)
at com.borland.jbuilder.designer.DesignerViewer.viewerActivated(Unknown Source)
at com.borland.jbuilder.designer.i.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
Top




