Adding to a databse (NOT ADO)

patnyc
04-20-2004, 08:31 PM
I'm not quite sure how to add to a database I've done a search on the forums but these lists are HUGE and they mostly cover ADO.

I cant use ADO because my school is retarded and the ADO Control is corrupt and we cant use it in our project.

I know I can use a simple Addnew but I want to make a seperate form that lets the user add a new entry into the database. Basically have them fill out a form and then it asks if they would like to enter it into the database or not.


Im not quite sure how to go about doing it.

Im creating a address book. thanks.

MKoslof
04-20-2004, 08:34 PM
Review the ADO for beginners tutorial in the knowledge base. You don't need an ADODC control, and in fact, you are better off NOT using them. Learn how to use standard ADO connection and recordset objects instead.

patnyc
04-20-2004, 08:38 PM
Review the ADO for beginners tutorial in the knowledge base. You don't need an ADODC control, and in fact, you are better off NOT using them. Learn how to use standard ADO connection and recordset objects instead.


Can I get a Link? I dont see it in the Knowledge base

MKoslof
04-20-2004, 08:40 PM
http://www.visualbasicforum.com/showthread.php?t=66994

patnyc
04-20-2004, 08:42 PM
http://www.xtremevbtalk.com/showthread.php?t=66994


Oh im sorry, I dunno if i was clear im kinda new to this....

I cant use the ADODB microsoft activex datacontrol, i can only use the default data controls of vb. the ADODB is corrupt on the schools network image.

couch612
04-20-2004, 08:55 PM
he's not suggesting you use the ADO data control. he is suggesting that you use the ADO data access method of manipulating data through code. do some searches on the following ADO methods for a start:

ADODB.Connection
ADODB.Recordset
Recordset.AddNew
Connection.Execute

patnyc
04-20-2004, 09:28 PM
he's not suggesting you use the ADO data control. he is suggesting that you use the ADO data access method of manipulating data through code. do some searches on the following ADO methods for a start:

ADODB.Connection
ADODB.Recordset
Recordset.AddNew
Connection.Execute


I know how to use Recordset.Addnew, but that method doesnt work out so well. I would like to have Input boxes come up asking what the new fields are to add. But thats the issue I am having. I know how to bring up input boxes and I know how to use a basic Recordset.addnew BUT I want to be able to ask the user what to add.

couch612
04-20-2004, 09:31 PM
well you can do this. a simple eg:



strResponse = InputBox("Enter something: ")

myRecordset.AddNew
myRecordset!myField = strResponse
myRecordset.Update

patnyc
04-20-2004, 09:38 PM
strResponse = InputBox("Enter something: ")

Data1.Recordset.AddNew
Data1!First_Name = strResponse
Data1.Update

"Cannot Assign to a Read-Only property"

couch612
04-20-2004, 09:41 PM
what is Data1? a data control? you are not supposed to be using a data control!! you are supposed to be opening a database via CODE, using the ADODB.Connection object. do some searching on the methods i posted before.

patnyc
04-20-2004, 09:44 PM
what is Data1? a data control? you are not supposed to be using a data control!! you are supposed to be opening a database via CODE, using the ADODB.Connection object. do some searching on the methods i posted before.

Ok I guess you didnt read my post. Or im confused. I cant use the ADODB object because it is corrupt at my school.

couch612
04-20-2004, 09:51 PM
yes you are confused, i understand u perfectly. you could always try using DAO code, and do some searches on that. i dont know how i can be any more clear. DO NOT USE ANY CONTROLS to read/manipulate data. ONLY USE CODE.

patnyc
04-20-2004, 10:22 PM
yes you are confused, i understand u perfectly. you could always try using DAO code, and do some searches on that. i dont know how i can be any more clear. DO NOT USE ANY CONTROLS to read/manipulate data. ONLY USE CODE.


ahhh i see ill try it.

patnyc
04-20-2004, 10:30 PM
ahhh i see ill try it.


Ok im really confused. I can connect to a database without useing any Database Control objects??

patnyc
04-20-2004, 10:36 PM
Ok im really confused. I can connect to a database without useing any Database Control objects??


Ok I think I understand now but I have another question...

MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\addressbook.mdb;"


I need it to goto the App.path for the addressbook.mdb, but I cant seem to figure out how to make it add in the app.path without error.

patnyc
04-20-2004, 11:03 PM
anyone this is URGENT?

wengwashere
04-20-2004, 11:27 PM
you mean something like this:


MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & app.path & "addressbook.mdb;"

MKoslof
04-21-2004, 10:27 AM
Bookmark this page:

http://www.connectionstrings.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum