VB4/16 and SQLServer Image columns/Access

VB4/16 and SQLServer Image columns/Access

Post by Frederic Boistuau » Tue, 04 Jun 1996 04:00:00



Hi ,

I'm trying to insert a picture file into an SQLSERVER Image column, or
access table

1: For SQLSERVER (using a database Object) Or Attached table (Using a
data control)
        MySet.AddNew fails and generate the following error, eventhough
I used dbOpenDynaset
        to allow updates and dbInconsistent allow inconsistant updates.
        Run time error 3027 , "Can't update batabase or object is read
only"

        What am I doing wrong here? Is it possible to save some Picture
(*.Ico, *.bmp...)
        into an SQLSERVER column without having to use ODBC API
functions like SQL_PUTDATA ?

2:For an access database
        MySet.AddNew does not fail. It's
        MySet.Fields("Picture") = Image1 that does.
        How do I insert an image in an ACCESS database.

Private Sub Command1_Click()
Dim MyDb As Database, MySet As Dynaset

'For access or attached tables
'Set MyDb = Workspaces(0).OpenDatabase("F:\Dev\Access\Test.mdb")
'Set MySet = MyDb.OpenRecordset("Select Picture From DBO_Pictures")

'For direct SQLSERVER
Set MySet = gdb.OpenRecordset("Select Picture From Pictures",
dbOpenDynaset, dbInconsistent)

    MySet.AddNew
        MySet.Fields("Picture") = Image1
    MySet.Update

MySet.Close

DataPicture.Refresh
End Sub

 
 
 

1. How can I access SQLServer TEXT fields from VB4 16-bit

When attempting to retrieve a SQLServer text field from within VB, I get a
Type Mismatch error.  Here is what I do:

Dim sSql$, rs As RecordSet

'COMMENT is a SQLServer TEXT field
sSql = "Select COMMENT from Member"

'Here is where I get the problem
Set rs = m_DB.CreateRecordset(sSql, dbCreatesnapshot)
.
.
.

Any Help?

Cyril

2. Update question

3. Error 3085 with Access 2.0/VB4(16), using calculated columns

4. create user, user exists

5. VB4/16 Connect to SQLSERVER using ODBC API Functions

6. VB, Crystal Reports & Oracle Problem

7. Accessing a secured Access 2.0 DB with VB4.0 16-bit

8. Old data being printed.

9. Access linked table column shows datatype text for oracle number column dimensioned as 16,0 why

10. VB4 - 16 Bit and Access for Win95

11. VB4 16 and Access 7.0

12. Copmpatibility between VB4.0 (16 bit)and access 97!!!!help