ODBC with SQL Server 6.5 in VB 4 
Author Message
 ODBC with SQL Server 6.5 in VB 4

Hi,

I'm now developing in VB 4.0 using ODBC to SQL Server 6.5.
I have successfully created a DataSource named 'dsVB4' and
use it in MS Query to read and update the tables with no
problem. But when I used the Connect string
        'ODBC;DATABASE=ICIIS;UID=ICIISUser;PWD=iciisuser;DSN=dsVB4'
of a Data control (named as 'datCustInfo') and the 'ICIISUser.CustInfo'
as the RecordSource of the datCustInfo, and tried to use datCustInfo
as the DataSource and 'Name' as the DataField of a Text box, the
table can only be read. I used datCustInfo.RecordSet.AddNew to
try to insert a new record, but it failed.

The error is
        Run-time error "3027".
        Can't update. Database or object is read-only.
when I run the statement, but the error becomes
        Run-time error "3426".
        The action was cancelled by an associated object.
when I modify the Text box and run the statement.

Am I missing something??

Any kind of help would be appreciated. Thanks in advance.

--
   ___  _          

 |  _  | / _` | ' \  Future Solutions Laboratory Limited (852)2319-2488
 |_| |_|_\__,_|_||_| Rm 317, HKITC, Tat Chee Avenue, Kowloon, Hong Kong



Sun, 06 Jun 1999 03:00:00 GMT  
 ODBC with SQL Server 6.5 in VB 4

Does the table you're working on have a declared primary key?  That could
be the problem...  Also, make sure that the database isn't accidentally in
read-only mode (run sp_dboption in the database or look at the options tab
in Enterprise manager editing the database).

--
Richard Waymire, MCT, MCSE

Visit us on the web: http://www.ariscorp.com



Quote:
> Hi,

> I'm now developing in VB 4.0 using ODBC to SQL Server 6.5.
> I have successfully created a DataSource named 'dsVB4' and
> use it in MS Query to read and update the tables with no
> problem. But when I used the Connect string
>    'ODBC;DATABASE=ICIIS;UID=ICIISUser;PWD=iciisuser;DSN=dsVB4'
> of a Data control (named as 'datCustInfo') and the 'ICIISUser.CustInfo'
> as the RecordSource of the datCustInfo, and tried to use datCustInfo
> as the DataSource and 'Name' as the DataField of a Text box, the
> table can only be read. I used datCustInfo.RecordSet.AddNew to
> try to insert a new record, but it failed.

> The error is
>    Run-time error "3027".
>    Can't update. Database or object is read-only.
> when I run the statement, but the error becomes
>    Run-time error "3426".
>    The action was cancelled by an associated object.
> when I modify the Text box and run the statement.

> Am I missing something??

> Any kind of help would be appreciated. Thanks in advance.

> --
>    ___  _          

>  |  _  | / _` | ' \  Future Solutions Laboratory Limited (852)2319-2488
>  |_| |_|_\__,_|_||_| Rm 317, HKITC, Tat Chee Avenue, Kowloon, Hong Kong



Sun, 06 Jun 1999 03:00:00 GMT  
 ODBC with SQL Server 6.5 in VB 4

Check if your probeties sheet is set to read only. Also you do not specify
the SQL statement. If ti includes a join you will only be able to update
fields in one side of the join at a time or not at all if it wilates the
rules defined on the server. but probably the problem is the primary key
thing. You can not update a table on sqlserver that does not have a primary
key



Quote:
> Hi,

> I'm now developing in VB 4.0 using ODBC to SQL Server 6.5.
> I have successfully created a DataSource named 'dsVB4' and
> use it in MS Query to read and update the tables with no
> problem. But when I used the Connect string
>    'ODBC;DATABASE=ICIIS;UID=ICIISUser;PWD=iciisuser;DSN=dsVB4'
> of a Data control (named as 'datCustInfo') and the 'ICIISUser.CustInfo'
> as the RecordSource of the datCustInfo, and tried to use datCustInfo
> as the DataSource and 'Name' as the DataField of a Text box, the
> table can only be read. I used datCustInfo.RecordSet.AddNew to
> try to insert a new record, but it failed.

> The error is
>    Run-time error "3027".
>    Can't update. Database or object is read-only.
> when I run the statement, but the error becomes
>    Run-time error "3426".
>    The action was cancelled by an associated object.
> when I modify the Text box and run the statement.

> Am I missing something??

> Any kind of help would be appreciated. Thanks in advance.

> --
>    ___  _          

>  |  _  | / _` | ' \  Future Solutions Laboratory Limited (852)2319-2488
>  |_| |_|_\__,_|_||_| Rm 317, HKITC, Tat Chee Avenue, Kowloon, Hong Kong



Wed, 09 Jun 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ODBC with SQL Server 6.5 in VB 4

2. ODBC Direct and SQL Server 6.5

3. ODBC Connect to SQL server 6.5

4. VB4, SQL Server 6.5, RDO and ODBC

5. Problems with ODBC drivers for SQL Server 6.5

6. ODBC and SQL Server 6.5 problem.

7. Creating ODBC connection to SQL Server 6.5 with VB4

8. ODBC error after upgrading to Microsoft SQL server 6.5

9. ODBC problem through CR6 and SQL Server 6.5

10. Weird ODBC error with Access95/VB5/SQL Server 6.5

11. Weird ODBC error with Access95/VB5/SQL Server 6.5

12. VB 5.0 and SQL Server 6.5 Contract

 

 
Powered by phpBB® Forum Software