Poojaaa's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
New Members
Active Posts:
8 (0.01 per day)
Joined:
29-September 12
Profile Views:
193
Last Active:
User is offline Oct 03 2012 02:54 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   Poojaaa has not set their status

Posts I've Made

  1. In Topic: Extracting a particular value from sql2000 database & then updatin

    Posted 2 Oct 2012

    View Postmodi123_1, on 01 October 2012 - 08:07 AM, said:

    yes, and we are telling you the sql syntax needs changing.

    No Use SIR it's not working
  2. In Topic: Extracting a particular value from sql2000 database & then updatin

    Posted 1 Oct 2012

    The spaces and single quotes are the part of the syntax. the user defined variables are declared as
    ' " & amt & " '
    
    What i want to do is a simple deposit transaction at bank. Balance should be added to the amount user want to deposit and new value shold be updated in database
  3. In Topic: Extracting a particular value from sql2000 database & then updatin

    Posted 1 Oct 2012

    IT IS NOT WORKING
  4. In Topic: This is my vb6 code with backend sql2000. Code is not able to validate

    Posted 30 Sep 2012

    THANK YOU
  5. In Topic: This is my vb6 code with backend sql2000. Code is not able to validate

    Posted 30 Sep 2012

    View Postmaj3091, on 30 September 2012 - 01:53 AM, said:

    Can you tell us what error you get, it's not clear from your post?

    Also a couple of points.

    1. Have a look at using a naming convention for your variables. Something along the lines of strMyName would be a string type with the name MyName, intPointer would be an integer type, etc., etc. This makes your code easier to read for yourself and others. At the moment you have variables n, a, p and ty which mean nothing.

    2. When declaring variables, either do it one on each line, or specify the type for each one. In your line "Dim accessconnect, n, a, num, ty As String", only ty is declared as string, the rest are declared as Variant type.

    These are just some suggestions to help you in future.


    Private Sub Command1_Click()
    02	 
    03	Dim conn1 As New ADODB.Connection
    04	Dim cmd1 As New ADODB.Command
    05	Dim rs1 As New ADODB.Recordset
    06	Dim p As Integer
    07	Dim accessconnect, n, a, num, ty As String
    08	accessconnect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=POOJA-D4FD585E2\SQL2000"
    09	conn1.ConnectionString = accessconnect
    10	conn1.Open
    11	cust_name = Text1.Text
    12	cust_address = Text2.Text
    13	contact_no = Val(Text3.Text)
    14	accnt_numbr = Text4.Text
    15	account_type = Text5.Text
    16	 
    17	cmd1.ActiveConnection = conn1
    18	cmd1.CommandText = " insert into customer(customer_name,customer_address,customer_phn,cutomer_dob,account_number,account_type) values(' " & cust_name & " ' , ' " & cust_address & " ',' " & contact_no & " ' , ' " & DTPicker1.Value & " ',' " & accnt_numbr & " ' , ' " & account_type & " ')"
    19	Set rs1 = cmd1.Execute
    20	conn1.Close
    21	MsgBox ("DATABASE UPDATED SUCCESSFULLY")
    22	End Sub
    23	 
    24	Private Sub Text1_Validate(Cancel As Boolean)
    25	cust_name = Text1.Text
    26	If cust_name = (" ") And (Len(cust_name) < 3) Then
    27	    MsgBox ("Enter valid customer name")
    28	    End If
    29	End Sub
    30	 
    31	Private Sub Text2_Validate(Cancel As Boolean)
    32	cust_address = Text2.Text
    33	If cust_address = (" ") And (Len(cust_address) < 3) Then
    34	    MsgBox ("Enter valid address")
    35	    End If
    36	End Sub
    37	 
    38	Private Sub Text3_Validate(Cancel As Boolean)
    39	contact_no = Val(Text3.Text)
    40	If Not IsNumeric(contact_no) And contact_no = (" ") And (Len(contact_no) < 10) Then
    41	        MsgBox "Please enter numbers only."
    42	    End If
    43	End Sub
    44	 
    45	 
    46	Private Sub Text4_Validate(Cancel As Boolean)
    47	accnt_numbr = Text4.Text
    48	If accnt_numbr = (" ") Then
    49	    MsgBox ("Account number cannot be null ")
    50	End If
    51	End Sub
    52	 
    53	Private Sub Text5_Validate(Cancel As Boolean)
    54	account_type = Text5.Text
    55	If account_type = (" ") Then
    56	    MsgBox ("Enter a type of account ")
    57	End If
    58	End Sub
    
    

    The problem is when i get input the code does not validate i.e if i leave all text fields empty then also the database is updated

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

Poojaaa hasn't added any friends yet.

Comments

Poojaaa has no profile comments yet. Why not say hello?