debasisdas 580 Posting Genius Featured Poster

try the simple code

con.begintrans              'con-----adodb connection object.
con.execute "your DML statement here"
con.committrans
debasisdas 580 Posting Genius Featured Poster

try to use

SAVESETTINGS
GETSETTINGS
DELETE SETTINGS

for the purpose.

debasisdas 580 Posting Genius Featured Poster

you must be connected to the database.

debasisdas 580 Posting Genius Featured Poster

what is the query that you are working on ?

debasisdas 580 Posting Genius Featured Poster

where is the code to modify.

the code only includes a select statement.

debasisdas 580 Posting Genius Featured Poster

if you are using oracle as database then can use external table for the best solution,but you need to extract the zip first.

debasisdas 580 Posting Genius Featured Poster

you need to parse the value before passing the same into database.

debasisdas 580 Posting Genius Featured Poster

the code is straight forward but i am afraid that is not the complete code and has some dependency with other parts of the code

debasisdas 580 Posting Genius Featured Poster

do you want to do all that from VB 6.0 ?

debasisdas 580 Posting Genius Featured Poster

"Love is as much of an object as an obsession, everybody wants it everybody seeks it, but few ever achieve it, those who do, will cherish it, be lost in it, and among all, will never...never forget it."

debasisdas 580 Posting Genius Featured Poster

-1149

debasisdas 580 Posting Genius Featured Poster

"Romance is the fuel that keeps love burning hot." ------ Rusty Silvey

debasisdas 580 Posting Genius Featured Poster

you need to increase field size of office_adress and other text fields.

debasisdas 580 Posting Genius Featured Poster

try using the following

Public Sub runOmitVendorQuery()
SQLomitVendor = "select UserRights from tblUSERS where UserID = " & CurrentDeviceUserID

Set rsOmitVendor = New ADODB.Recordset
rsOmitVendor.Open SQLomitVendor, cnConnection, adOpenDynamic
End Sub
debasisdas 580 Posting Genius Featured Poster

you need to use proper variable type and modify the fields in database table to accomodate data that you are going to pass from application.

debasisdas 580 Posting Genius Featured Poster

ensure that you are passing a number for number field with out any special characters

you are getting 0 means there is something wrong with the input string through textbox or any other control

debasisdas 580 Posting Genius Featured Poster

use the following

SQL = "INSERT INTO Supplier(Supplier_ID, Supplier_name,Fax_No,Contact_person,Contact_No,Supp_Type,Office_Address,Emails,website) values(" & val(Combo1.Text) & ",'" & Text1.Text & "'," & val(Text2.Text) & ",'" & Text3.Text & "'," & val(Text4.Text) & ",'" & Text5.Text & "','" & Text6.Text & "','" & Text7.Text & "','" & Text8.Text & "')"
debasisdas 580 Posting Genius Featured Poster

ensure to pass number value only (not text) for the fields

Supplier_ID
Fax_No
Contact_No


use val(te3xtboxname)

debasisdas 580 Posting Genius Featured Poster

check the query that is being framed at run time and try to run the same from backend directly.

debasisdas 580 Posting Genius Featured Poster

that simply means you need to pass data of proper type to insert statement.

debasisdas 580 Posting Genius Featured Poster

how you decide if the user is an admin user or not ?

what is the logic for that ?

is there is corresponding field for that value as well ?

debasisdas 580 Posting Genius Featured Poster

you need to open the recordset as per selection of the combobox input and pass the same recordset to report.

debasisdas 580 Posting Genius Featured Poster

recheck your code

rename the type field to something else more meaningful.

pass the value in proper format as per database field type.

debasisdas 580 Posting Genius Featured Poster

"What is done out of love always takes place beyond good and evil".

----Friedrich Nietzsche

debasisdas 580 Posting Genius Featured Poster

help how can i know if the user is not an admin

i have combo box in my combo box have a user or admin additem if he choose admin then all i want is to validate if the username and password is for admin user this is my code

please post clearly using correct english and grammer.

debasisdas 580 Posting Genius Featured Poster

simple crate the table2 and run the following

insert into table1 select * from table1

debasisdas 580 Posting Genius Featured Poster

use the following code

con.BeginTrans
SQL = "INSERT INTO Supplier(Supplier_id,Supplier_name,Fax_no,Contact_person,Contact_no,Type,Office_address,emails,website) values('" & Combo1.Text & "',' " & Text1.Text & "','" & Text2.Text & " ',' " & Text3.Text & " ','" & Text4.Text & "','" & Text5.Text &  "','" & Text6.Text & "','" & Text7.Text & "','" & Text8.Text & "')"
con.Execute SQL
con.CommitTrans
debasisdas 580 Posting Genius Featured Poster

why you are passing 10 values for 9 field s ???

debasisdas 580 Posting Genius Featured Poster

you only want to take back up of the table or want the transaction to be affected in both the tables.

if u want only back up then simply copy the table or the entire database file.

debasisdas 580 Posting Genius Featured Poster

avoid using ' (single quote) while passing values from textbox.

post the sql insert statment that you are getting.

debasisdas 580 Posting Genius Featured Poster

check my previous post and correct accordingly

before executing the sql , check the same using msgbox.

debasisdas 580 Posting Genius Featured Poster

try this

Private Sub Command2_Click()
    If (CheckInput) Then
       End If
    Y = MsgBox("do you add this record", vbYesNo + vbQuestion, "message")
    If Y = vbYes Then
        Set con = New ADODB.Connection
        con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=\\asfserver\itp$\product_tabletest.mdb"
        con.BeginTrans
        SQL = "INSERT INTO Supplier(Supplier_id,Supplier_name,Fax_no,Contact_person,Contact_no,Type,Office_address,emails,website) values(" & Text1.Text & ",'" & Text2.Text & "'," & Text3.Text & ",'" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" & Text7.Text & "','" & Text8.Text & "','" & Text9.Text & "')"
       con.Execute SQL
      con.CommitTrans
    End If
End Sub
debasisdas 580 Posting Genius Featured Poster

Ensure to pass text into text field and number into number field. extract number from textbox and pass to query after converting to number. else you might have to make some changes in the insert statement.

debasisdas 580 Posting Genius Featured Poster

try the following sample

dim sqlstmt as string

sqlstmt = "INSERT INTO Supplier(Supplier_id,Supplier_name,Fax_no,Contact_person,Contact_no,Typ,Office_address,emails,website) values(" & text1.text & ",'" & text2.text & "'," & text3.text & ",'" & text4.text & "','" & text5.text & "','" & text6.text & "','" & text7.text & "','" & text8.text & "','" & text9.text & "')"

con.Execute sqlstmt

also better change the field name Type to something more meaning ful, becuase that is a keyword.

debasisdas 580 Posting Genius Featured Poster

you need to frame the insert statmnet dynamicaly by passing values

debasisdas 580 Posting Genius Featured Poster

the following discussion might be useful for you.

link

debasisdas 580 Posting Genius Featured Poster

you can use loop inside a sub program for the purpose.

debasisdas 580 Posting Genius Featured Poster

what is the database that you are using ?

debasisdas 580 Posting Genius Featured Poster

1) FRM-----form file contains all the componenets and code there of.
2) BAS-----module file contains objects with global access
3) FRX-----form binary file contains images of FRM file.
4) OCX----windows components.
5) CLS----class file contains the classes defined if any.
6) VBP-----visual basic project.

hope that helped you.

debasisdas 580 Posting Genius Featured Poster

why you have passed all those ???? marks in place of values, while not using any parameters.
values you need to capture from textboxes and those need to be properly formatted before passing to database.

debasisdas 580 Posting Genius Featured Poster

do not expect us to guess and solve your problem.

Please post the structure of your tables.

debasisdas 580 Posting Genius Featured Poster

are you trying to prepare the insert script for all the tables ?

debasisdas 580 Posting Genius Featured Poster

Why you need all the lengthy code
just try this

con.begintrans       'con---ADODB connection object.
con.execute "your insert statment here"
con.committrans
debasisdas 580 Posting Genius Featured Poster

try the following

dim con as new adodb.connection

con.open "your connection string here"

add my previous code after this line

debasisdas 580 Posting Genius Featured Poster

better use ADODB library for the purpose. try the sample code below

con.begintrans        'con-----adodb connection object
con.execute "your sql insert statment here"
con.committrans
debasisdas 580 Posting Genius Featured Poster

1.take backup of the table.
2.create new table with vertical model
3.then you need to remap the old data to new model

in this step you will face some diffucilty.
I will try to post some easy solutions for you later on.

debasisdas 580 Posting Genius Featured Poster

are you trying to convert the horizontal model to horizontal ?

debasisdas 580 Posting Genius Featured Poster

try the following code with ADO

con.begintrans            'con--ADODB connection object
con.execute "put your sql statement here "
con.commitrans
debasisdas 580 Posting Genius Featured Poster

better to use some expression that will evalute to boolean.

the previous post is a better example of the same.

debasisdas 580 Posting Genius Featured Poster

"Upon thy cheek I lay this zealous kiss, as seal to the indenture of my love"

William Shakespeare in King John, Act ii, Sc.1