Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Problem with DAO (Import from Excel to Access)! :(

 
   Database Help (Home) -> Visual Basic -> DAO RSS
Next:  Use DAO to add fields to existing Access table  
Author Message
And1

External


Since: Aug 02, 2006
Posts: 1



(Msg. 1) Posted: Wed Aug 02, 2006 7:25 pm
Post subject: Problem with DAO (Import from Excel to Access)! :(
Archived from groups: microsoft>public>vb>database>dao (more info?)

Hi,
I am novice and I have problem. I need import some data with Excel file
to Access.
Problem introduces as follows:
In Excel(first sheet) i have data:
"TYTUL" - column "A"
"NAZWISKO" - column "B"
"IMIE" - column "C"
"PRZEDMIOT" - column "D".
Excel file name is AND.xls

In Access i have table - AS_PRZEDMIOT.
Table "AS_PRZEDMIOT" contains fields:
ID_PRZEDMIOT (Auto),
P_AKTYWNY (Number),
P_ID_GRUPA (Number),
P_ID_KATEDRA (Number),
P_ID_KIERUNEK (Number),
P_NAZWA (String),
P_NAZWA_0 (String),
P_NAZWA01 (String),
P_SKROT (String),
P_UWAGI (String)
UPDATE_DATE (Number),
UPDATE_USER (String),
P_SKROT_0 (String),
P_SKROT_01 (String).

I need import data from Excel (PRZEDMIOTY - column "D") to Access (field
P_NAZWA). Additionally to every record in field P_AKTYWNY insert number "1".

How to do?
I try in support about example modules VBA (in Accesss):
but I do not know how to modify (use) this code?
How to make this the best?

Sub Test(Tabela_rs As String)

Dim rs As DAO.Recordset
Dim rd As DAO.Recordset


Set rs = CurrentDb.OpenRecordset(Tabela_rs, dbOpenSnapshot)
Set rd = CurrentDb.OpenRecordset("AS_Przedmiot")



rs.MoveFirst

While Not rs.EOF

rd.AddNew

'rd![ID_PRZEDMIOT] = rs![ID_PRZEDMIOT]
rd![P_NAZWA] = rs![P_NAZWA]

' .....

rd.Update

rs.MoveNext

Wend

End Sub

Sub StartTest()
Test ("AS_Przedmiot")
MsgBox "sukces"
End Sub

Kind Regards,
Andrzej.

 >> Stay informed about: Problem with DAO (Import from Excel to Access)! :( 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
problem setting "RecordSource" in Office Access 2007 ... - I have a form in Office Access 2007, the "RecordSource" property of which I;m trying to set. But first, I some background: have a push button control at the top of each column in my "overview" form that, when pressed, is supposed to ...

Using Jet data control to write numbers to an excel spread.. - Hi, I'm currently using the vb data controls to write numbers to excel spreadsheets using the Jet driver. Unfortunately, even though the data being sent to the spreadsheet is numbers, excel has a nasty habit of showing them as text, requiring them t...

Error after converting from Access 97 to Access 2002-2003 .. - Hello, I convert my Access 97 Database to Access 2002-2003, because I’m now using WinXP. And now when I run my VB program, I get Runtime error '3343' - Unrecognized database format. I'm using DAO350.DLL. Do I have to change to another DLL? Thanks. ....

VB6 Access 2000 : Error 3085 undefined function, works wh.. - I've been using VB6 with DAO 3.6 and an Access 2000 format database fine for a few years. I recently added a module function that one of the Access queries uses. It is only called from with the Access query. When I try to set the first parameter from....

Password problem - Hey, I've been using ADO for a few years now and now I need to simply open an access DB using DAO3.6 which has is password protected. set dbtemp = opendatabase("MyDB.MDB",False,False," ;pwd=mypass") I get an error about "canno...
   Database Help (Home) -> Visual Basic -> DAO All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]