473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

VB6 help anyone please??

1
(i'm totally clueless when it comes to vb) i'm getting "compile error invalid use of property"
with the error
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdDelete_Click() (at here)
  2. Dim db1 As ADODB.Command
  3. db1 = New ADODB.Command
  4. db1.ActiveConnectio n = "A:\db1.mdb"
  5. db1.CommandType = adCmdText
  6. db1.CommandText = "delete * from order where orderid=" & txtOrder.Text
  7. db1.Execute
  8. End With
  9. End Sub
  10.  
all i am trying to is is when i enter in a order id (shown in the pic) and click on delete it goes into the database find the id and the row of information and deletes it and i'm getting nowhere with the code , if i've gone totally from can some explain to me how i could do this please?

Mar 2 '06 #1
3 1834
(i'm totally clueless when it comes to vb) i'm getting "compile error invalid use of property"
with the error

Private Sub cmdDelete_Click() (at here)



all i am trying to is is when i enter in a order id (shown in the pic) and click on delete it goes into the database find the id and the row of information and deletes it and i'm getting nowhere with the code , if i've gone totally from can some explain to me how i could do this please?

[IMG]http://img95
.imageshack.us/img95/3931/pic9md.th.jpg[/IMG]
Dim db1 As ADODB.Command
db1 = New ADODB.Command
db1.ActiveConnectio n = "A:\db1.mdb"
db1.CommandType = adCmdText
db1.CommandText = "delete * from order where orderid=" & txtOrder.Text
db1.Execute
End With
End Sub

I don't know but like me i think the error is in the commandtype because on my compyter the error is in the command type change the command type and you will see how this work(Change the command type with a "acCmdText")!!!



(((HACKER)))
Apr 19 '08 #2
debasisdas
8,127 Expert 4TB
You need to create a connection object and the same connection must be opened before doing any operation on database .
Apr 21 '08 #3
Killer42
8,435 Expert 8TB
Which line produces the error, anyway?

Oh, and by the way - won't that End With produce an error? There's no With statement.
Apr 21 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Programatix | last post by:
Hi, I'm working on a project which includes WebServices and Windows Form application. The Windows Form application will call the WebServices to retrieve data from database. The data will be...
1
by: Harag | last post by:
Hi all Classic ASP, Textpad Local "test" WebServer. IIS5 Well my MS script debugger isn't running and I can't findout why. I'm sick of it failing on me so was looking for an alternative. I...
2
by: pratchaya | last post by:
This is my sample error in my MySQL Log New value of fp=(nil) failed sanity check, terminating stack trace! Please read http://www.mysql.com/doc/en/Using_stack_trace.html and follow instructions...
2
by: spamharvestor | last post by:
I want to learn C. As I was searching for helpful links, I came across this message with many C and C++ links - http://tinyurl.com/8ep3f However, most of the links shown, such as ...
2
by: Brent Taylor via AccessMonster.com | last post by:
HELP----DOES ANYONE HAVE A SIMPLE .mdb for MLM structure? Does anyone have an example database for multi-level marketing for a 3 Tier setup? Thank you, brenttaylor@actionimports.net
4
by: Hai Nguyen | last post by:
I'm learning C sharp and do not like vb much. I'm creatiing a wepage using panel to test myself. I tried to use these code below, which is written in VB, and to transform them to c sharp but I got...
8
by: CM | last post by:
Hi, Could anyone please help me? I am completing my Master's Degree and need to reproduce a Webpage in Word. Aspects of the page are lost and some of the text goes. I would really appreciate it....
0
by: Blubaugh, David A. | last post by:
To All, Has anyone worked with the F2PY generator? This is something that is supposedly built within numpy and scipy for the Python environment. I was wondering if anyone has encountered any...
1
by: Blubaugh, David A. | last post by:
Pauli, Yes, I am utilizing the windows environment. I cannot install f2py. I obtain the following error when I try to execute the setup.py file within the f2py folder located within the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.