ok ive set up a connection between my access db ( 97) and my vb6 interface and this is what i got - form_load
-
Data6.DatabaseName = App.Path & "\cjmillers.mdb"
-
Data6.RecordSource = "select * from Orders"
-
-
-
'............................
-
'Counts how many order_ID's in the table Orders
-
'Orderidno is how many in the table
-
'Orderidlist = Orderidno -1
-
With Data6
-
-
.Refresh
-
.Recordset.MoveFirst
-
orderidno = DCount("[Order_ID]", "Orders")
-
Label17.Caption = orderidlist
-
orderidlist = orderidno - 1
-
Do Until .Recordset.EOF
-
For i = 0 To orderidlist
-
Combo3.List(i) = .Recordset.Fields(0)
-
.Recordset.MoveNext
-
Next i
-
Loop
-
End With
-
'............................
And a different form - Dataloginuser.DatabaseName = App.Path & "\login.mdb"
-
Dataloginuser.RecordSource = "select * from user"
-
-
-
'*********************************
-
'Fieldno = then number of [name] in the table "user"
-
'Field = the number of [name] in the table "user" minus 1
-
'[name] in the table user in the db cjmillers.mdb
-
-
With Dataloginuser
-
.Refresh
-
.Recordset.MoveFirst
-
fieldno = DCount("[name]", "user")
-
Text6.Text = fieldno
-
Field = fieldno - 1
-
Do Until .Recordset.EOF
-
For i = 0 To Field
-
Combo1.List(i) = .Recordset.Fields(0)
-
'Combo1 user selection combobox
-
.Recordset.MoveNext
-
Next i
-
Loop
-
End With
The only problem with this is that i have to manually open the database before i run my program with is annoying and i want to avoid. So can someone give me some hints or tips to fix this :(
i have a login db (called login.mdb) and a "main" db called cjmillers.mdb which hold all the order details etc.
when i login it works fine and i dont need to open the db manually but when i try and connect to the "main" db after i log in i have to open up the db or it comes up with a reserved error 2950.
Thanks in advance and i hope someone can help :D
P.s i think its something to do with the Dcount as that is whats highlighted on error
8 1689
Are you trying to open the database while connection is established to the application.
i run my program, login, it goes to the main menu and in the main menu's form load it connects ( that code i posted before)
yes i have to open the db then run my program for it to connect propperly, i want it so u dont have to open the db before you run the program... so it connects when the program runs
Kindly post the exact error message with error number.
Run-time error '2950':
Reserved error
when i click debugg the Dcount line is highlighted in yellow
P.s how you make the code text appear in colour ?
yes i have to open the db then run my program for it to connect propperly, i want it so u dont have to open the db before you run the program... so it connects when the program runs
Hello,
You are using 2 DB, 1 for the Login and 1 for the main DB..
Anyway, Im not using that way.
I have here a sample connecting VB6 and DB, Follow the Link and
Study my attachment.. http://www.thescripts.com/forum/thread719352.html
Regards
Ervin
P.s how you make the code text appear in colour ?
Use proper code tags in all your codes.
Use proper code tags in all your codes.
Thank you :P
............
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Anand |
last post by:
Hi i am having trouble adding a recordset into the access database,
the code seems to be working fine it passs and parses through all
variables just fine without showing any errors and also when i access
the recordset it displays the results, what the real issue is that the
entry is not made into the database even though i use the Update
command and i have also tried the BeginTrans and CommitTrans nothign
seems to work and i am unable to...
|
by: Curt Emich |
last post by:
I get the following error when I write any code against a connection that is
hooked to an Access database:
The Microsoft Jet database engine cannot open the file
'C:\Inetpub\wwwroot\TimeTracker\Data\TimeTracker.mdb'. It is already opened
exclusively by another user, or you need permission to view its data.
Does anyone have any idea what to do about this?
|
by: aka |
last post by:
Hi
I have a DB2 v8.1 on AIX and DB2 Connect EE on Solaris wich is connected to
OS/390 DB2 subsystems via APPC / SNA. I have cataloged the DB2 Connect
instance as tcpip node and then the Host DB cataloged on that node...this
works from v7.2 Fixpack 11 clients and servers, but with v8.1 server I get
SQL1334N.
Does anyone has an idea?
Thanks
|
by: Jim |
last post by:
Is it possible to have a Connection class that opens up connection to my DB
and leaves it open until I decide to close it?
I run many SQL statements so I was wondering if it's possible to call a
Class1.GetProducts that sets up an SQL statement and then calls another
Class2.Connect that actually opens up the connection Class2.Connect would
not receive anything (since the connections string is always the same) and
would not return anything....
|
by: B B |
last post by:
Okay, here is what's happening:
I have a reasonably fast laptop (1.4 GHz Mobile M, so comparable to 2.5GHz
P4) doing .net development.
Running Windows XP pro, SP2
IIS is installed and running fine
All SQL Servers I am referring to share a small (10 computers or so) LAN
with a 100MB Switch.
No other computers on the LAN exhibit this problem.
| |
by: Tim |
last post by:
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <u$xxJS#OEHA.3300@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: dsl21.htonline.net 12.159.202.82
Lines: 1
Path:...
|
by: Pavils Jurjans |
last post by:
Hello,
I have two questions regarding the Session state.
1) Is there some way on the server to programmatically access the other
active sessions? Well, perhaps the question should be formulated not "is
there a way", but "how to do it", because that almost inevitably must be
possible - after all, the ASP.NET enables access for all the session users
to their respective sessions. Perhaps studying the full request lifetime,
and finding...
|
by: blackpuppy |
last post by:
I am just beginner on PHP. I am reading "Spring Into PHP 5" but cannot
make the ftp examples work.
I am running PHP scripts on a Fedora Core 5 (VMWare virtual machine) on
top of a Windows XP Professional. The PHP version is 5.1.4. The PHP
script is shown below.
#! /usr/bin/php
<?php
$ftp_server = "myftpserver";
|
by: hoetat |
last post by:
When I try to open a connection to the database I hit an error
"Object reference not set to an instance of an object."
I have make a simple test connection function same error coming out when open connection as the line in 9 "connect.Open();". Here my function:
private void butConnect_Click(object sender, System.EventArgs e)
{
SqlConnection connect = null;
try
{
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |