Access MSAccess using VB6

It's been long that I wrote a code so please excuse the conventions of naming and the coding novice.

In VB6, I have successfully open a MS Access 2003 database with the following code

Public void OpenDatabase()
Dim Msg As String
   
DbOpened = True

MyFile = App.Path & "\PrintDir.MDB" ' set database name.

On Error GoTo OpenDatabase_eh
As the value = Workspaces (0)
   
'Open database.
MyDatabase value = MyWorkspace.OpenDatabase (MyFile)

Exit Sub

After I update the database with the following code

Public Function UpdateDatabase (strFileName As String)
Dim intErrNbr As Integer
Dim Msg As String
Dim strErr As String
Dim a As Integer

On Error GoTo UpdateDatabase_eh
   
If strFileName As String = "" then
Exit Function
End If

BeginTrans
Set MyTable = MyDatabase.OpenRecordset ("FileInfo", dbOpenDynaset)
   
MyTable.AddNew
MyTable! [FileName] = strFileName
.

.

.

MyTable.Update
               
gstrFileName = «»
glngFileSize = 0
gvarFileDateCreated = «»
gstrFileComments = «»
   
CommitTrans
MyTable.Close
   
Exit Function
       
UpdateDatabase_eh:
   
intErrNbr = Err
strErr = error
"MSG =" Err = "& intErrNbr &" ', error = "& strErr & +"\n"& +"\n"
MSG = Msg & "" & gstrFileName
MsgBox Msg, vbCritical
Rollback
On Error GoTo 0
   
End Function

However, when I try to delete the entries in the table, not on the table, before updating the table, I get the error 2075, 'the operation requires an open database'.

Private Function DeleteTableContents()
Dim strMsg As String
Dim intAns As Integer
Dim DSQL As String
Dim intDCount As Integer
Dim xclSQL As String
  
On Error GoTo DeleteTableContents_eh
Set MyTable = MyDatabase.OpenRecordset ("FileInfo", dbOpenDynaset)

DSQL = "" DELETE * FileInfo FileInfo.FileName ".
DSQL = DSQL & 'WHERE not FileInfo.FileName = Xtest.jpg' ' & 'isnull.

"doCmd.SetWarnings False."

DoCmd.RunSQL() DSQL
"doCmd.SetWarnings True."
MyTable.Close

Exit_DeleteTableContents:
Exit Function

DeleteTableContents_eh:
MsgBox "DeleteTableContents - error number =" & Err.Number & ", Error = Description" & Err.Description "" "."
CV Exit_DeleteTableContents
   
End Function

Can you see what I'm missing?

Thank you

Try asking in the forums of Visual Basic:
http://social.msdn.Microsoft.com/forums/vstudio/en-us/home?Forum=vbgeneral

Tags: Windows

Similar Questions

  • I got a notification saying "password requirement: you must change your secret code in 56 minutes"I panicked and entered my access code using the little box? ". I ' t mess up?

    I got a notification saying "password requirement: you must change your secret code in 56 minutes"I panicked and entered my access code using the little box? ". I ' t mess up?

    Yes. You may be victim of a scam, except if you are connected to your business with this requirement.

    Change your password immediately below:

    https://appleid.apple.com.

  • Computer stops automatically when you access internet using Chrome or Mozilla

    I'm having a problem with my computer. I use Windows 7 Professional. The problem is that when I use Chrome or Mozilla, the computer stops after a while (20-30 minutes) and when I use Internet Explorer, the computer hangs after 1 or 1/2 hour and then I have to restart my computer.

    Original title: computer shuts down automatically

    Hi Ashhadkhan,

    Have you made changes on the computer before this problem?

    Method 1:

    I suggest to start the computer in safe mode with network and try to access the Internet using Firefox or Google Chrome.

    Step 1:

    Check out the link to start in safe mode with networking

    Startup options (including safe mode).

    http://Windows.Microsoft.com/en-in/Windows7/advanced-startup-options-including-safe-mode

    Step 2:

    If you are able to access internet using Firefox or Google Chrome without the computer stops, I suggest you perform a clean boot.

    See the link to perform the clean boot.

    How to perform a clean boot in Windows

    http://support.Microsoft.com/kb/929135

    Note: After troubleshooting, see the section «How to reset the computer to start normally after a boot minimum troubleshooting»

    For any problem, with the freezing of the computer when you use Internet explorer:

    Crashes Windows or freezes

    See (my computer crashes or freezes when you navigate in Internet Explorer) http://support.Microsoft.com/kb/2681286/en-us

    Anti Virus Disclaimer : The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

    Additional information:

    You can also check the following links, these will help you improve the performance of your computer.

    Optimize Windows to improve performance.

    http://Windows.Microsoft.com/en-us/Windows/optimize-Windows-better-performance#optimize-Windows-better-performance=Windows-7

    Important: Running chkdsk on the drive if bad sectors are found on the disk hard when chkdsk attempts to repair this area if all available on which data can be lost.

    Note: The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

    I hope this helps to solve the problem. Please come back for any clarification on this or any issue of Windows. We will be happy to help you.

  • Impossible to access by using ASDM SSM10

    Hi guys,.

    I have cisco ASA5520 with SSM10 Transparent mode configuration. I am able to access ASA5520 CLI and ASDM by.

    However, I am only able to access SSM10 CLI only. Whenever I tried to access by using ASDM, I get "Unable to launch the Device Manager" error.

    Please let me know if I missed anytinhg.

    Firewall # sh ip int brie

    Interface IP-Address OK? Method State Protocol

    GigabitEthernet0/0 172.16.63.6 YES unset upward, upward

    GigabitEthernet0/1 172.16.63.6 YES unset upward, upward

    GigabitEthernet0/2 no YES not defined administratively down down

    YES GigabitEthernet0/3 10.10.1.1 unset upward, upward

    Internal-Control0/0 127.0.1.1 YES unset upward, upward

    Internal-Data0/0 not assigned YES unset upward, upward

    Management0/0 192.168.1.1 YES not defined administratively down down

    BVI1 172.16.63.6 YES unset upward, upward

    See the module

    Firewall # sh module

    Model serial number of map mod

    --- -------------------------------------------- ------------------ -----------

    0 ASA 5520 Adaptive Security Appliance, ASA5520 JMX1620X076

    1. ASA 5500 Series Security Services Module-10 ASA-SSM-10 JAD16190760

    MAC mod Fw Sw Version Version Version Hw address range

    --- --------------------------------- ------------ ------------ ---------------

    0 5057.a80e.e71d for 5057.a80e.e721 2.0 1.0 (11) 5 8.4 (3)

    1 5057.a8db.bb76 to 5057.a8db.bb76 1.0 1.0 (11) 5 2.0000 E4

    The Application name of the SSM status Version of the Application of SSM mod

    --- ------------------------------ ---------------- --------------------------

    1 IPS                            Up               7.0(2)E4

    Data on the State of mod aircraft compatibility status

    --- ------------------ --------------------- -------------

    0 to Sys does not apply

    1 up Up

    SSM10 configuration (network configuration)

    View the settings of Sensor(config-HOS-net) #.

    the network settings

    -----------------------------------------------

    Host-ip: 172.16.63.7/24,172.16.63.1 default: 192.168.1.2/24,192.168.1.1

    host name: default UTUSAN-SSM10-primary: sensor

    Telnet-option: disabled by default: disabled

    access-list (min: 0, max: 512, current: 1).

    -----------------------------------------------

    network address: 0.0.0.0/0

    -----------------------------------------------

    -----------------------------------------------

    FTP timeout: 300 seconds

    text-banner-login:

    primary DNS server

    -----------------------------------------------

    disabled

    -----------------------------------------------

    -----------------------------------------------

    -----------------------------------------------

    secondary DNS server

    -----------------------------------------------

    disabled

    -----------------------------------------------

    -----------------------------------------------

    -----------------------------------------------

    Thanks in advance. :)

    Kind regards

    SIVA

    Hello reda,.

    You can go to the java 6 version.

    Concerning

  • Hello, if I update to creative cloud other members of my team on CS5 will be able to access and use my files until I save as IDML?

    Hello, if I update to creative cloud other members of my team on CS5 will be able to access and use my files until I save as IDML?

    They will be able to open your files, but is not a long-term viable work flow.

    Features specific to newer versions will be lost or flattened when they open files, reflow of text is possible and even probable in both senses.

    A durable workflow requires that you all on the same version.

  • Why do I need internet access to use lightroom?

    Why do I need internet access to use lightroom? When I go to a lot of photos and want to do captive capture with my laptop, creative cloud wonder for internet access / wireless, which i do not always have and therefore cannot use the application.

    Thank God I have an older version of lightroom on my computer, or else I would be screwed and embarrassed in front of the customer.

    can someone help me with this?

    You can use the CC without connecting to the internet for up to 90 days unless you have some jobs as send photos to your clients or to others.

    Connect to Adobe CC at least once within 90 days is required to keep the active CC.

    Concerning

    Stéphane

  • Do I need a continuous Internet access to use my Creative Suite apps?

    Do I need a continuous Internet access to use my Creative Suite apps?

    N ° your desktop creative cloud (like Photoshop and Illustrator) applications are installed directly on your computer, so you won't need a continuous Internet connection to use on a daily basis.

    An internet connection is required the first time you install and your applications of office of license, but you can use applications offline with a valid license. Desktop applications will try to validate your software licenses every 30 days.

    For annual members, you can use the applications up to 99 days in offline mode. Months of members may use the software for 5 days in offline mode.
  • My Bank States cookies must be enabled. They are, but not access. Used to work 6 months ago.

    This happened with a recent update; It worked before, but now, no password is registered and I can not access my Bank (sitehttps://www.labanquepostale.com/particulier.html indicates that cookies must be enabled to access the customer area), and Statcounter requires also that daily entry of the password.

    Two sites work correctly on IE11 (I use windows 10 - don't like Edge!)

    Don't follow not, and follow-up care are checked. Custom settings - cookies - accept the 3rd part of visit - don't forget not check passwords.

    Have you tried to use the site with basting disabled protection?

  • Can't access paypal using firefox

    Hello:
    I was able to connect to paypal, amazon using firefox.
    then I changed my cookie setting...
    and problems...
    ---
    now
    I can connect to paypal using Opera. Cookies enabled.

    I checked firefox as usually, I do not accept cookies. I changed it to 'Accept cookies from sites' WE.
    Firefox closed
    Open Firefox

    still no access to the paypal site.

    So it seems that the intensity of old cooking for paypal not leave is always there, I can't ignore it.
    How to replace it?

    Thank you

    Ok. I fixed it.

    He passed for
    PayPal
    Amazon

    FIREFOX cannot save a change to the existing kitchen, for example, I changed to not be able to. AND IT MADE NO DIFFERENCE. possible bug?

    to fix:
    Firefox security preferences
    Under Hitory (Middle display)
    I chose Firefox will use 'custom settings '.
    as I want to be asked before cooking setting. See screenshot
    ---
    to fix:
    Click the EXCEPTIONS button to this page
    See screenshot 1

    then to find relevant naughty cookies, the origin of the problem
    1 I clicked on status column so sort by BLOCK

    2 a highlighted block ALL cookies (not ideal... because now I will ask you for all those ad sites I hate... but nothing great thing else I can do... than firefox a bug... of only records not not the cookie status change)

    3 then click on REMOVE all sites (see image 2)
    --
    THEN
    When I go into the site... popup FIREFXOX "do you want all" is displayed. This time I say ALLOW

    YES, we allow paypal, amazon if we want to use their site.
    ---
    and sorted in the Amazon, paypal

    .. Firefox has recorded these 2 sites in exceptional
    ---
    hope this is clear.

  • 7000 R as point of access one using the integrated switch

    I use the first 7000 R as a router and the second 7000 R as an Access Point. I can even if need the integrated switch of one Access Point is this switch automatically connect with the same netzwork?

    Marcel

    You can use all of the ports on the R7000 in AP mode. They are in the same network. If your access point is configured properly on the ports of the AP devices, should receive a valid IP address / gateway to the Base R7000 (DHCP server). You could even hang it cut one of thos ports, if you wanted to... Make sure that you are running at least cable CAT5e Ethernet between the R7000 AP and the Station of Base R7000 to connect the two devices.

  • 403 Access denied using XP sp3 IE8 try to update windows

    I had to reinstall the operating system and since it doesn't have access to Windows updates.

    Get 403 Access denied... tried to use MS fixit no joy...

    When you access the Microsoft Windows Update Web site at the address of a Microsoft Windows XP computer that is behind a firewall or a proxy server, you cannot download the updates.

    To resolve this issue, make sure that the proxy server or the firewall is configured for anonymous access to the Windows Update Web site. Include the following destinations when you create the destination set or URL set for Windows Update:

    Note See the documentation for your proxy server or your firewall for how to configure the proxy server or the firewall for anonymous access.

    http://www.checkupdown.com/status/E403.html
    UTC/GMT is 06:45 on Wednesday, September 7, 2011

  • Not to access Internet using WRT54G Router wireless

    I'll try to provide as much information as possible. My mother-in-law gave me his wrt54g router so that we could get Netflix through our Wii. I have an old Compaq laptop for a year and am running Windows 7 with a wireless Internet connection through my service provider. I installed the router with no problems and was able to do online with the Wii. However, I am more able to get Internet access on my desk. It shows that my Internet is connected but it displays "no network access.  I had on fine at first, then I went on the 192.168.1.1 site to configure my data.  I changed my time zone and then to secure my connection.  I don't remember the exact option that I chose, but I think it was something like personal WAP2. As soon as I selected the screen has frozen and I can not access this site or access the Internet through the router. If I unplug my Ethernet cable from the router and plug it directly into the pc I get very well online. I know that this router works with a PPPoE connection, because it's what my mother-in-law a. tried to get support from my ISP, but they left open-mouthed via chat.  Can someone help me understand how to get this router to allow me access so I can use office and the Wii?  Thank you.

    Fix it!  I called my local service provider and explains the problem. He had me go in the settings of the router and change the connection between "Connect on Demand ' and 'Keep Alive '.  Everything works fine now.  Thank you!

  • WAP54G Access Point using wireless mode, but not worked. :(

    I bought today WAP54G.
    My son and I have PC but we distance between our room each other and
    wireless signal is not strong enough sometimes.
    My son has wired Internet w / WRT54GS router and I have wireless
    USB G adapter to my room.
    Cat w / Linksys rep, the other day and he recommended buying WAP54G and I could leave this AP @ salon and do not need to have the connection cable.

    Anyway, I don't know how to install this customer service, called today
    and she told me that I need to install the CD in my computer. But there is no
    connection by cable or router and I cannot install CD in my computer.
    So, I installed the CD in the PC of my son who has wired Internet and
    router. The installation has been completed.
    After the installation, turn off AP and move on to the living room.
    Then, there is no "link" light on. Lamp only Power and act on.

    Tried chat w / online but offline and it is really difficult to chat w /.
    them.

    Please let me know:
    1. can I use this without wired access point?
    I would like to implement the AP @ living room (between my son and my room)
    2. which PC do I need to install CD? But once again, my PC have no cable
    connection and cannot install the CD.

    I am very beginner wireless and PC so please tell me step by step.
    I read manual and I used the installation CD Wizard but still do not work.

    Please someone help me.

    I think that you must configure your AP as Repeater wireless... Follow the link here , make sure that when you set your Access Point to the "Wireless Repeater" mode, this device will communicate only with a different Access Point Linksys (WAP54G) and wireless G of Linksys (WRT54G) router...

  • Only local access while using the USB modem

    Hi, I have a laptop dell inspiron with Vista home premium preinstalled in it. For about 3 years I use GPRS (internet) with modem USB on it without problem. It was working fine but application stopped working 15 days before. I tired every thing from different forums but the only "Local access" message is fix... now, after trying a lot of different things I get of the internet world for 5 minutes but it goes to new local only access. But within 5 minutes no Web site is too load. I have no problem with my connection to the LAN and wireless. They both work fine(I hv tested). Its only for my nokia usb modem. I HAV tried to use GPRS to different operators, but it is givin local only access for all, and when consulted internet in all mobile phones are workign fine.  I also tried to use microsoft fix but it gave an error file not found and ignored den and ran some checks of registrey and claimed restart. But no change in connectivity.
    Help, please.

    Hello

    ·          Update you the network card with the latest drivers?

    Method 1:

    I suggest that you disable Antivirus software and firewall temporarily on your computer and check if you are able to connect.

    Note: Please make sure that you enable the antivirus software and firewalls after the test to keep your computer protected.

    Method 2:

    You can try the manual steps suggested in the following article:

    http://support.Microsoft.com/kb/928233

    Note: serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base: (http://windows.microsoft.com/en-US/windows-vista/Back-up-the-registry ) how to back up and restore the registry in Windows)

  • Access PIX using SSH when connected remotely with VPN client

    Hello

    I think that this should be a fairly simple for someone to sort for me - I'm new to PIX configuration If Yes please excuse my stupidity!

    I changed the config on our PIX to allow only access via SSH (rather than via telnet as it was previously configured)

    Now, everything works fine when I'm in the office - I can connect to the PIX using SSH without any problem.

    However, if I work from home and connect to the office using my VPN client (IPSEC tunnel ends on the PIX firewall itself) I find that I can not connect to the PIX.

    I have configured the PIX to access ssh on the office LAN subnet and the client pool of IP addresses used for VPN connections by using the following commands:

    SSH 172.64.10.0 255.255.255.0 inside

    SSH 192.28.161.0 255.255.255.0 inside

    where the 1st line is reference to the office's LAN, which works very well, and the 2nd line denotes the IP address pool configured on the PIX for VPN access.

    Can someone tell me how to fix this? I have the feeling that its something pressing!

    Thank you

    Neil

    Try the command "management-access to the Interior.

Maybe you are looking for

  • After the update my avast it stopped working. Help!

    I've updated my avast security and he stopped running, he says cannot find my shields and a fatal error due. Any help you can give me? I can't even uninstall the avast now to reinstall. It would be incompatible with Firefox?

  • When computer booting XP, get "error loading C:\WINDOWS\sversrit.dll".

    Hi, can someone help me please. I get the message "Error loading C:\WINDOWS\sversrit.dll" when windows starts. I think it might have something to do with Outlook Express, because around the same time I started having problems with forwarding of email

  • Example: Pavilion s5123w: update information

    Ive updated my HP Slimline s5123w-card mother m2n68 - la. With a 380 Watt power supply - 4 GHz Ram - AMD Athlon64x2 7850 Kuma 2.80 GHz Dual Core Black edition processor. And my os is win.10 64 bit does anyone know if I can install 8 GHz of Ram and ge

  • need list of the F key functions... ThinkVantage connections

    As Lenovo set up their NEW site useless and stupid they REMOVED all marked PAGES bookmarked. I need a list of all functions for th F keys used with FN keys. Can anyone help to "Please? Stupid me I have bookmarked the page and it does not copy down an

  • Access denied to the 2nd hard drive in Win 7 Professional 64

    I installed Win 7 Professional 64 with two volumes (drives C and F) RAID mirroring. Everything was working fine and then all of a sudden, I can't access the second RAID - F drive. The hard drive (drive F) appear in the disk management tool and that i