Click here to Skip to main content
16,015,094 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Code to help me make Millionaire type game Pin
vertigo_one2-May-04 20:22
vertigo_one2-May-04 20:22 
GeneralDatagrid Control Pin
Pugman8122-May-04 11:27
Pugman8122-May-04 11:27 
GeneralRe: Datagrid Control Pin
Tran Quoc Thang2-May-04 21:05
Tran Quoc Thang2-May-04 21:05 
GeneralProgrammatic Calendar Control Pin
_Tendo2-May-04 1:56
_Tendo2-May-04 1:56 
GeneralRe: Programmatic Calendar Control Pin
Dave Kreskowiak2-May-04 2:02
mveDave Kreskowiak2-May-04 2:02 
GeneralRe: Programmatic Calendar Control Pin
_Tendo2-May-04 18:50
_Tendo2-May-04 18:50 
GeneralRe: Programmatic Calendar Control Pin
Dave Kreskowiak3-May-04 2:13
mveDave Kreskowiak3-May-04 2:13 
GeneralVB COM DLL doesn't allow to update data from database using ADO Pin
vertigo_one1-May-04 14:53
vertigo_one1-May-04 14:53 
Hi, I'm creating a COM Dll using VB6, I created simple functions to make an update on a database, but it doesn't work, I'm using an ASP Page that succesfully create the object but gives me errors when I try to insert or update data (Also I tried creating the object from other VB Application but didn't work either, 'weird' but when I use this code on a EXE it works, but I need this in a COM Dll).

VB Dll Code

Public Function Save()<br />
    Dim Cn As New ADODB.Connection<br />
    <br />
    Cn.ConnectionTimeout = 100<br />
    Cn.ConnectionString = "DBQ=test.mdb;" & _<br />
        "DRIVER={Microsoft Access Driver (*.mdb)};" & _<br />
        "DefaultDir=C:\My Docs\My Source Code\VB\ASP-COM Test;" & _<br />
        "UID=admin; PWD=;"<br />
    Cn.Mode = adModeReadWrite<br />
    Cn.Open<br />
<br />
    Cn.Execute "INSERT INTO tests (test_value) VALUES ('test3')"<br />
<br />
    Cn.Close<br />
<br />
    Save = True<br />
End Function


ASP page code

<%<br />
	Dim iTest<br />
	Set iTest = Server.CreateObject("TestProject.Test")<br />
<br />
	Response.Write iTest.Save<br />
%>


Like this it returns this error

Error Type:<br />
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)<br />
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.<br />
/xue2/index.asp, line 6


I also tried using a RecordSet Object but gives this error:

Error Type:<br />
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)<br />
[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only.<br />
/xue2/index.asp, line 6


Thanks if anyone can help!
Vertigo
GeneralRe: VB COM DLL doesn't allow to update data from database using ADO Pin
Hesham Amin1-May-04 20:45
Hesham Amin1-May-04 20:45 
GeneralRe: VB COM DLL doesn't allow to update data from database using ADO Pin
vertigo_one1-May-04 20:58
vertigo_one1-May-04 20:58 
QuestionGrabbing each character of a string, how? Pin
ScarberryProd1-May-04 6:26
ScarberryProd1-May-04 6:26 
AnswerRe: Grabbing each character of a string, how? Pin
Hesham Amin1-May-04 6:36
Hesham Amin1-May-04 6:36 
GeneralRe: Grabbing each character of a string, how? Pin
ScarberryProd1-May-04 7:05
ScarberryProd1-May-04 7:05 
AnswerRe: Grabbing each character of a string, how? Pin
Jeff Varszegi1-May-04 7:07
professionalJeff Varszegi1-May-04 7:07 
GeneralPicture box draw commands? and text in a picture box? how Pin
ScarberryProd1-May-04 6:19
ScarberryProd1-May-04 6:19 
GeneralRe: Picture box draw commands? and text in a picture box? how Pin
Dave Kreskowiak1-May-04 12:46
mveDave Kreskowiak1-May-04 12:46 
GeneralRe: Picture box draw commands? and text in a picture box? how Pin
ScarberryProd1-May-04 12:47
ScarberryProd1-May-04 12:47 
GeneralRe: Picture box draw commands? and text in a picture box? how Pin
Dave Kreskowiak2-May-04 4:30
mveDave Kreskowiak2-May-04 4:30 
Generalprinting forms and picture boxes Pin
ScarberryProd1-May-04 6:15
ScarberryProd1-May-04 6:15 
QuestionAre dimensional arrays possible? how? Pin
ScarberryProd1-May-04 6:14
ScarberryProd1-May-04 6:14 
AnswerRe: Are dimensional arrays possible? how? Pin
Dave Kreskowiak1-May-04 12:41
mveDave Kreskowiak1-May-04 12:41 
GeneralRe: Are dimensional arrays possible? how? Pin
ScarberryProd1-May-04 12:48
ScarberryProd1-May-04 12:48 
GeneralDynamic Querystring in repeater template Pin
1-May-04 1:00
suss1-May-04 1:00 
Questionhow shall i design a TSR application Pin
NewtonOfComputers1-May-04 0:56
NewtonOfComputers1-May-04 0:56 
AnswerRe: how shall i design a TSR application Pin
Dave Kreskowiak1-May-04 3:18
mveDave Kreskowiak1-May-04 3:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.