我正在尝试将一些数据从 ac# 应用程序插入到 AS400 服务器。我在控制面板中创建了一个 DSN,数据源:
Data source name : Newissues
Description :iSeries Access for Windows ODBC data source
Connection type : use odbc access mode
在 C# 中,我使用了 OdbcConnection 。我的连接字符串是:
DSN=newissues; UID=strUser; PWD=strPassword;DBQ=DBName; QueryTimeOut=0;
从 C# 我可以打开数据库并进行选择,但是当我尝试插入或删除时,我收到了这条消息:
ERROR [HY000] [IBM][iSeries Access ODBC Driver][DB2 UDB]SQL7008 - test in DBName not valid for operation.
我的插入命令是:
INSERT INTO DBName.test VALUES('0730',' 10230526')
我还尝试从我有链接服务器的 sql server 插入数据,但我收到相同的消息错误:
insert openquery(MyLinkServer,'select "IACO","IAPOLNUM" from DBName .test WHERE 1=0') VALUES('0730',' 10230526')
错误:
OLE DB provider "MSDASQL" for linked server "MyLinkServer" returned message "[IBM] [System i Access ODBC Driver][DB2 for i5/OS]SQL7008 - test in DBName not valid for operation.".
Msg 7343, Level 16, State 2, Line 1
The OLE DB provider "MSDASQL" for linked server "MyLinkServer" could not INSERT INTO table "[MSDASQL]".
有人可以帮我解决这个问题吗?谢谢