Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 28th, 2007, 09:13 AM
Registered User
 
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi guys!

I was trying the asp code inserting into my project. And I had problemes with "adOpenKeyset, adLockOptimistic, adCmdTable"

I even don't know what it is those adxxxx.
The error message he gives is "name adOpenKeyset is not declared.

But if I watch the code there is no place where he gets declared.

Could someone please helpe me with this? It's quiet urgent cause I have a deadline on this for tomorrow so i'm kindly screwd

 
Old April 26th, 2007, 04:35 PM
Registered User
 
Join Date: Apr 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by Bob Bedell
 Turns out the Jet OLE DB provider is smart enough to handle the whole exchange.
<% @Language = VBScript %>
<% Option Explicit %>


<html>
<head>
    <title>Import Data From Excel into Access</title>
</head>
<body>
<%
    Dim cnnExcel, rstExcel
    Dim cnnAccess, rstAccess
    Dim strExcelFile
    Dim strAccessFile

    strExcelFile = Server.MapPath(".") & "\ExcelExportData.xls"
    strAccessFile = Server.MapPath(".") & "\AccessImportData.mdb"
......................................
THANKS A LOT BOB!
This code worked without any hassle. Also I could import data in SQL Table also.

I kept COLUMN HEADINGS (in my Excel table) and used "HDR=YES" in EXCEL connection STRING. Without a single error the code worked with following code....

Code:
Do Until rstExcel.EOF
    With objRS
        .AddNew
        .Fields("DHSID") = rstExcel.Fields("dhsid").Value
        .Fields("EMPID") = rstExcel.Fields("empid").Value
        .Fields("Name") = rstExcel.Fields("name").Value
    End With
    rstExcel.MoveNext
Loop
objRS.UpdateBatch
Response.Write "Records written from Excel to SQL<p>"
BOB! I LOVE YOU BROTHER >:d< Gimme a hug. Your code was for excel to Access, but it was soooo simple that I could easily use this code for SQL Table also without any error. Thanks again.

Mahendra C,
Mumbai, India.






Similar Threads
Thread Thread Starter Forum Replies Last Post
import excel to access Vision G Access 1 October 15th, 2008 02:12 PM
Fail to auto import excel to access table Ivanchan Access VBA 2 April 19th, 2007 09:34 PM
Import Excel File to access database Komila ASP.NET 1.0 and 1.1 Professional 7 October 7th, 2006 12:45 AM
Import Data from Open Excel Sheet to Access chintu4u Pro VB Databases 0 May 15th, 2006 01:24 AM
Import an excel file into access arjunvs Access VBA 1 September 15th, 2004 07:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.