|
|
|
"Recordset is read-only" - такая ругань при попытке Insert/Delete строку в БД.
|
|||
|---|---|---|---|
|
#18+
Горит, помогите плиз!!!!! "Recordset is read-only" - такая ругань при попытке Insert/Delete строку в БД. Подскажите, где искать этот флажок read-only в Recordsete. Каркас проекта создавался Мастером в Visual C++.Net . Подсоединяюсь к SQL серверу CString CTestSet::GetDefaultConnect() { return _T("DSN=DataSourceTest;APP=Microsoft\x00ae Visual Studio .NET;WSID=AAA-5RHDC48GY3I;Trusted_Connection=Yes"); } Не сочтите за труд черкнуть пару строк... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 26.12.2004, 17:51 |
|
||
|
"Recordset is read-only" - такая ругань при попытке Insert/Delete строку в БД.
|
|||
|---|---|---|---|
|
#18+
Нууу... (в-нулевых, я, блин, так скоро всё, нафиг, забуду...) Во-первых, надо посмотреть в самой базе свойства таблицы. Во-вторых, что скорее всего, в свойствах коннекта... (типа у _ConnectionPtr, словами ADO) или непосредственно в параметрах запроса... msdnExecuteOptionEnum Specifies how a provider should execute a command. Constant Value Description adAsyncExecute 0x10 Indicates that the command should execute asynchronously. This value cannot be combined with the CommandTypeEnum value adCmdTableDirect. adAsyncFetch 0x20 Indicates that the remaining rows after the initial quantity specified in the CacheSize property should be retrieved asynchronously. adAsyncFetchNonBlocking 0x40 Indicates that the main thread never blocks while retrieving. If the requested row has not been retrieved, the current row automatically moves to the end of the file. If you open a Recordset from a Stream containing a persistently stored Recordset, adAsyncFetchNonBlocking will not have an effect; the operation will be synchronous and blocking. adAsynchFetchNonBlocking has no effect when the adCmdTableDirect option is used to open the Recordset. adExecuteNoRecords 0x80 Indicates that the command text is a command or stored procedure that does not return rows (for example, a command that only inserts data). If any rows are retrieved, they are discarded and not returned. adExecuteNoRecords can only be passed as an optional parameter to the Command or Connection Execute method. adExecuteStream 0x400 Indicates that the results of a command execution should be returned as a stream. adExecuteStream can only be passed as an optional parameter to the Command Execute method. adExecuteRecord Indicates that the CommandText is a command or stored procedure that returns a single row which should be returned as a Record object. adOptionUnspecified -1 Indicates that the command is unspecified. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 27.12.2004, 11:24 |
|
||
|
"Recordset is read-only" - такая ругань при попытке Insert/Delete строку в БД.
|
|||
|---|---|---|---|
|
#18+
Я ж говорил, что нагоню.... моды конекта: msdn ConnectModeEnum Specifies the available permissions for modifying data in a Connection, opening a Record, or specifying values for the Mode property of the Record and Stream objects. Constant Value Description adModeRead 1 Indicates read-only permissions. adModeReadWrite 3 Indicates read/write permissions. adModeRecursive 0x400000 Used in conjunction with the other *ShareDeny* values (adModeShareDenyNone, adModeShareDenyWrite, or adModeShareDenyRead) to propagate sharing restrictions to all sub-records of the current Record. It has no affect if the Record does not have any children. A run-time error is generated if it is used with adModeShareDenyNone only. However, it can be used with adModeShareDenyNone when combined with other values. For example, you can use "adModeRead Or adModeShareDenyNone Or adModeRecursive". adModeShareDenyNone 16 Allows others to open a connection with any permissions. Neither read nor write access can be denied to others. adModeShareDenyRead 4 Prevents others from opening a connection with read permissions. adModeShareDenyWrite 8 Prevents others from opening a connection with write permissions. adModeShareExclusive 12 Prevents others from opening a connection. adModeUnknown 0 Default. Indicates that the permissions have not yet been set or cannot be determined. adModeWrite 2 Indicates write-only permissions. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 27.12.2004, 11:27 |
|
||
|
"Recordset is read-only" - такая ругань при попытке Insert/Delete строку в БД.
|
|||
|---|---|---|---|
|
#18+
Спасибо, что откликнулись! 1) С таблицами в базе все ОК. 2) Свойства коннекта. ("DSN=DataSourceTest;APP=Microsoft\x00ae Visual Studio .NET;WSID=AAA-5RHDC48GY3I;Trusted_Connection=Yes"); По умолчанию - не read only, можно специально указать - только для чтения, но мне это не нужно, поэтому не указываю. Про моды коннекта ничего не понятно: где они указываются и как? Хоть бы ма-а-а-аленький примерчик... C Recordset тоже не все ясно: попадались на глаза описания битовых масок, где есть и read-only. Но как и где их применять не понятно... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 27.12.2004, 12:27 |
|
||
|
|

start [/forum/topic.php?fid=57&msg=32845621&tid=2033925]: |
0ms |
get settings: |
9ms |
get forum list: |
20ms |
check forum access: |
5ms |
check topic access: |
5ms |
track hit: |
51ms |
get topic data: |
14ms |
get forum data: |
4ms |
get page messages: |
48ms |
get tp. blocked users: |
1ms |
| others: | 240ms |
| total: | 397ms |

| 0 / 0 |
