Jja 1
New Member
Hello,
I am very new to this site. before i start may i first introduce myself
i am 'Jhalil, a beginner Vb6 programmer. i stumbled on this site on my
quest for a code in vb that can connect me to either Microsoft sql or Mysql
server. Infact i was suprised to see people with different programming
problems. That is how i became a member of this good family.
Now can anybody help? i am a beginner in VB 6, i enjoy writing codes
but i do not know much of explicit declaration (option explicit), when i write
codes, i do not decalare, i use only Dataenvironment for my connection, and
my database is "Access" within Vb 6. Now my question:
I have a project containing one form (frm1), Database name Jhalil, Table name
is "Jjb", my database was created at c:\ directory. My form has three labels and
three textfield, lblname,lbladdr ess, lblphone; and txtname,txtaddr ess, and txtphone respectively. Can anyone help me with a code to connect to this database which reside at c:\ "through option" explicit declaration.
3 1345 jeffstl 432
Recognized Expert Contributor
Drag an ADO data control on to your form.
Check the properties, and you will see that you can build a simple database connection from this control with the properties.
If you want a more dynamic database connection you will have to probably have to declare your connection manually and check this site:
www.connections trings.com
Hi Jja. Welcome to TheScripts. :)
I'd just like to point out that you leave yourself open to a lot of problems by not using Option Explicit. Because allowing VB to automatically create variables any time you use them means that it will never tell you if you get a variable name wrong. This can make debugging your code very difficult. Take the following simple example... -
For iiiiiii = 1 To 5
-
Debug.Print iiiiiiii
-
Next
-
If you think this would print the numbers 1 to 5, you've just demonstrated the very problem I was describing, because those are not the same variable. with Option Explicit set, VB would stop and tell you at compile time.
Obviously I've exaggerated the issue here for illustrative purposes by using such an obscure variable name, but believe me, the problem does occur.
ayshamalik, your post constituted a new question, so I've split it off to it's own discussion thread. I should tell you though, you'll need to be more specific about things like what version of VB you're using, and exactly what you want to do. If it's just how to connect to Oracle, that has been covered tons of times. Try the Search button at the top, or just read the responses in this thread.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: AMC |
last post by:
Hi,
I'm using an include file to store the connection string to a database.
Whenever I try to reference that string to open a connection in the page
that includes the file I get the error 'empy connection string' . When I
write the string to the page using response.write(connectionstring) it shows
up fine. Is the something else that I need to do?
Thanks
|
by: Stub |
last post by:
Docs says that "The compiler does not use an explicit constructor to
implement an implied conversion of types. It's purpose is reserved
explicitly for construction."
I put up code of three cases at the bottom. Hope you can help me understand
the "explicit" keyword and its usage. Specifically,
Is "explicit" keyword only associated with constructor in C++?
What's "implied conversion of types"?
|
by: ranges22 |
last post by:
******************************************************************
I am compiling a librarry which has a .h file containing th
following:
******************************************************************
template<typename T> void from_string(const char Str, T &Obj);
template<> void from_string(const char Str, long &); //
template<> void from_string(const char Str, unsigned lon
&); //
|
by: Anthony England |
last post by:
This is a simple question, which has been debated before, but can I ask it
again with reference to a specific example? The question is basically
should I close and set to nothing an ADO connection object? Normally, I
would do this and not worry about whether I could have chosen not to bother.
However, in this example, setting the variable to nothing can take ages, up
to 15 seconds, and I wonder whether it is worth it.
I would like a...
|
by: John Kotuby |
last post by:
Hi all,
I am simply trying to include the Option Explicit declaration at the top of
an ASP page and am getting an error:
Error Type:
Microsoft VBScript compilation (0x800A0400)
Expected statement
/transferkey.asp, line 2
| |
by: mlg1906 |
last post by:
I'm developing an intranet site in ASP.NET 2.0 but I can't seem to
connect to the DB from within my code. I've created a .vb class that
houses a private Connection() that other functions within the class can
call to connect to the database. In the calling function, I've declared
my connection object and called the "Open" method on the object.
However, when I attempt to execute the stored procedure command by
calling the "ExecuteScalar"...
|
by: petschy |
last post by:
hello,
i've run into an error when qualifying a copy ctor 'explicit'. the
strange thing is that i get a compiler error only if the class is a
template and declare the variable as X<Zx = y. X<Zx(y) is fine.
Tested with gcc 2.95, 3.3, 4.1, all gave the same error:
t.cpp: In function 'int main()':
t.cpp:44: error: no matching function for call to
'D<int>::D(D<int>&)'
|
by: Barry |
last post by:
The following code compiles with VC8
but fails to compiles with Comeau online,
I locate the standard here:
An explicit specialization of any of the following:
|
by: Rahul |
last post by:
Hi Everyone,
I have the following code and i'm able to invoke the destructor
explicitly but not the constructor. and i get a compile time error
when i invoke the constructor, why is this so?
class Trial
{
public: Trial()
{
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |