Inserting Data From Msflexgrid
i have 5 columns and many rows in msgrid rows are depend on data entry
it can be 10 or 15 or many columns are only 5 I want to insert grid data in sql table through
"insert into table" how should i write a insert statement so one by one row get inserted in a sql table
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Inserting A Column In An MSFlexGrid
I know how to insert a row in an MSFlexGrid using the AddItem property, but I can't seem to find a way to insert a column.
I am using the MSFlexGrid with an overlayed text box control to do my edits.
Here's what I'm looking for:
Upon the Click event of a command button, I want a new column to be added to the left of wherever my current location is in the grid.
I will also be looking for some type of similar delete column fuctionality, but I am sure if I can get an understanding of how to insert a column, delete should be a snap.
Inserting A Checkbox In MsFlexGrid
How do you insert a checkbox into a cell in a MsFlexgrid.
There is a example of a combobox insertion into a cell in the MSDN knowledge base but it seems complicated and I though there must be a easiler method.
Any ideas !
Inserting Data From A Data Input Form In A Word Document
I have next to no knowledge of VB and have volunteered to create a template containing several input forms.
I have designed the forms in VBA (which include check boxes and combo box) but I have no idea how I’m going to get the data from the forms into the Word document.
For the form containing combo boxes, there could be several entries so I have 2 command buttons, one which should allow the user to add the contents of the combo boxes to a table in Word and then be able to add another entry to the table from the form. The other button should add the contents of the combo box to the table and close the form and open a new one.
I know I’m completely out of my depth here so any help would be greatly appreciated.
Edited by - julesl on 7/23/2003 3:38:57 AM
Inserting Data Into Word Document Using ADO Data Control
Iam trying to replace some of the text in my word document with the data present in the access tables.Iam using ADO data control for connectivity to the tables.But the problem is that iam unable to give the correct syntax in the "replacewith" field while replacing the current text.
Could some one plz help me out here?
Urgent: Please Help... This Is Regarding Data Grids And Inserting Data Into It
I'm in such a bit rut... i need anyone's help urgently... I'm working on this college project of a dental system that adds, edits, views and deletes information... i'm using ADO Connection and am facing a problem with filtering results in my datagrid...
when i startup the form... it gets all the data in the database according to the table that my datasource is set... now i want to filter the results according to the PatientID or Name criteria... this are my codes... could you please take a look at them and let me know what you think has gone wrong with it... i'm so dead if this isn't solved by tomorrow... Thank You So Much in Advance....
Public Sub FilterData(myId As String, SearchNum As Integer)
Dim SQLQuery As String
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
If SearchNum = 1 Then
SQLQuery = "SELECT PatientID, Name, IDNumber, DOB " _
& " FROM PersonalDetails " _
& " WHERE PatientID LIKE '" & myId & "'"
ElseIf SearchNum = 2 Then
SQLQuery = "SELECT PatientID, Name, IDNumber, DOB " _
& " FROM PersonalDetails " _
& " WHERE Name LIKE '" & myId & "'"
rs.Open SQLQuery, DatabaseCon
.ConnectionString = DatabaseCon
Set .Recordset = rs
'I Think This Is Where The Trouble Begins
Set SearchGrid.DataSource = AdodcSearch
Set rs = Nothing
Transfer Of Data From Msflexgrid To Another Msflexgrid
how can i transfer the values of first row of Msflexgrid1 to first row of Msflexgrid2 placed in parallel of 1st one .
Moved from Code Bank - VB6 to VB General forum
Edited by - djjeavons on 2/19/2006 1:48:00 AM
Inserting Data Using SQL
I am trying to insert data into a table and can't seem to do it.
The database is Access 2000 and everthing I have read about SQL suggests the INSERT iNTO command which Access doesn't recognize.
I can select the records I want using the following code:
strSQL = "SELECT ContractNum, PmtStatus, CommissionStat, LastPmt "
strSQL = strSQL & "From tblContract"
strSQL = strSQL & " WHERE Month(LastPmt) = " & Month(dtpMonth.Value)
strSQL = strSQL & " AND year(LastPmt) = " & Year(dtpMonth.Value)
strSQL = strSQL & " AND (((IsDate(CommissionStat))=False)) AND (((IsDate(LastPmt))=True))"
adoCommission.RecordSource = strSQL
When I try to add and use the UPDATE and SET it doesn't work. I have tried everything that I can think of to no avail.
Can anybody suggest an approach I can take or a source for information to help me solve this problem. I'm at my wits end.
I'm very new at VB.....
All I want to do it add values to column names, into one variant (called paramters) that I can feed to a function that will add these values to the appropriate columns in the database. Here's the script:
Set pls_manager = CreateObject("PLS_Managers.PLSParameterMgr.1")
RoleName = "TestRole"
Set parameters = CreateObject( "ADODB.RecordSet" )
parameters.Fields.Append "PLS_SUBST_MARK", 16 'adTinyInt
parameters.Fields.Append "PLS_PRIORITY", 2 'adSmallInt
parameters.Fields.Append "PLS_LOWERLIMIT", 5 'adDouble
parameters.Fields.Append "PLS_UPPERLIMIT", 5 'adDouble
parameters.Fields.Append "PLS_TOLERANCE", 5 'adDouble
parameters.Fields.Append "PLS_USER_STATUS_MASK", 3 'adInteger
parameters.Fields.Append "PLS_STATUS_MASK", 3 'adInteger
parameters.Fields.Append "PLS_LIMITCHECK", 16 'adTinyInt
parameters.Fields.Append "PLS_GAPCHECK", 16 'adTinyInt
parameters.Fields.Append "PLS_STATUSCHECK", 16 'adTinyInt
' Fill record set with data
parameters.Fields( "PLS_SUBST_MARK" ).Value = 1
parameters.Fields( "PLS_PRIORITY" ).Value = 1
parameters.Fields( "PLS_LOWERLIMIT" ).Value = 1
parameters.Fields( "PLS_UPPERLIMIT" ).Value = 2
parameters.Fields( "PLS_TOLERANCE" ).Value = 1
parameters.Fields( "PLS_USER_STATUS_MASK" ).Value = 2
parameters.Fields( "PLS_STATUS_MASK" ).Value = 1
parameters.Fields( "PLS_LIMITCHECK" ).Value = 1
parameters.Fields( "PLS_GAPCHECK" ).Value = 1
parameters.Fields( "PLS_STATUSCHECK" ).Value = 1
pls_manager.Add_Role RoleName, 1, parameters
WScript.Echo "Script finished"
The error I get is "not a 2d array of variants (9 VT_DISPATCH)"
Help In Inserting Data Into Db !
When i try to insert data into db, a msgbox pop up n shows me this error:
Run-time error '-2147467259 (80004005)'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.
and here is my code im trying to play with:
Private SQL As StringPrivate conDB As New ADODB.ConnectionPrivate myRS As New ADODB.Recordset Private Sub Command4_Click() Dim CUSTINST As Integer Dim strInput As String Dim FileName As String Dim AgreeNo As String Dim ServNo As String Dim FirstInst As String Dim Interest As String Dim Insurance As String Dim LoanMonths As String Dim Balance As String CUSTINST = FreeFile() Open "C:Documents and SettingskeenDesktopCUSTINST.txt" For Input As CUSTINST While Not EOF(CUSTINST) Line Input #CUSTINST, strInput Set conDB = New ADODB.Connection conDB.Open Connection1 'here's the problem encountered FileName = Mid$(strInput, 1, 10) AgreeNo = Mid$(strInput, 11, 7) ServNo = Mid$(strInput, 18, 7) FirstInst = Mid$(strInput, 26, 5) & "." & Mid$(strInput, 32, 2) Interest = Mid$(strInput, 34, 5) & "." & Mid$(strInput, 40, 2) Insurance = Mid$(strInput, 42, 5) & "." & Mid$(strInput, 48, 2) LoanMonths = Mid$(strInput, 50, 2) Balance = Mid$(strInput, 52, 5) & "." & Mid$(strInput, 58, 2) List4.AddItem (FileName + " - " + AgreeNo + " - " + ServNo + " - " + FirstInst + " - " + Interest + " - " + Insurance + " - " + LoanMonths + " - " + Balance) SQL = "insert into dbo.PPP_Installment values ('" & AgreeNo & "', '" & ServNo & "', '" & FirstInst & "', '" & Interest & "', '" & Insurance & "', '" & LoanMonths & "', '" & Balance & "')" conDB.Execute SQL Wend Close #CUSTINST End Sub
can anybody help me in this?
Inserting Data With ' In It Using Sql
When creating an SQL string to Insert or update.. or do anything with a record.. if you have a ' in the data as in
"SELECT * FROM table WHERE UserId = ' " & txtUserId & " ' "
if user id was "john's" then you get an error because of the ' in the ID.. it doesn't parse the SQL statement right because it thinks that the ' is where the string ends....
isn't there a way to use ' in your strings when dealing with SQL other than doubling it as '' ???? right now I have a function that replaces ' with '' in strings but you can't run it on the entire SQL statement.. only on the strings before you make the sql statement....
Dim cl As Range
For Each cl In [Sheet2!A1:C5]
Worksheets("SHEET3").Cells(cl.Value, cl.Column) = "1"
here is the code I'm using right now and it works fine as you can see if sheet2 looks like this:
then the formula will insert a "1" in sheet3 cell A5,A9,A15,A33and A40 the problem is repetitive numbers
if the A column looks like this
then sheet 3 column A cell A1 should have a "2" and cell A4 would get "1"
the data is always 3 different numbers or 1 number and 2 repetitive numbers or
3 repetitive( in which case a "3" would be inserted
thanks for any help
Edited by - lneilson on 1/16/2005 7:10:31 AM
Inserting Data At The Top Of A File
I need to insert data at the top a of a file. These files can be huge and therefore I dont want to have to re-write the whole file.
I need a prepend function that will very quickly add a single line (column headings) as the first line in the file (as opposed to an Append function)
Selecting And Inserting Data
I need to display records from my database into a MSHFlexgrid and then select a row by highlighting it. Next, I will need to use the selected row of data and populate another form.
I have already managed to populate the MSHFlexgrid.
Qn1) How do I highlight the selected row after I have double-clicked on it?
Qn2) How do I pass the selected record of data to the next form?
Can anyone help?
Inserting Data Into Database
i am using access to build a DB
want the firt col in the db to be a unique key that
with every line i insert it grows in 1!
now : when i insert a new line into the db how can i get the
current new line number?
thanks in advance
Need Help With Inserting Data Into Sql Table
I have a form containing textboxes of txtID, txtSYSNAME, txtSYSTYPE, txtFREQ, txtPOP and a [Save] button to insert the data into an sql table.
The form also have a sqlconnection1, sqldataadapter1, and a generated dataset named WV2. The problem I'm having is that the following code does not perform an insert operation and it does not generate any errors. I'm new to vb.net, so any help is appreciated.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim p_idn, p_fq, p_pop As Int32
Dim p_name, p_type As String
p_idn = txtID.Text
p_name = "'" & Trim(txtSYSNAME.Text) & "'"
p_type = "'" & Trim(txtSYSTYPE.Text) & "'"
p_fq = Convert.ToInt32(txtFREQ.Text)
p_pop = Convert.ToInt32(txtPOP.Text)
SqlDataAdapter1.InsertCommand.CommandText = "INSERT INTO test (idnumber,sysname,systype,bacfreq,population) VALUES values (p_idn, p_name, p_type, p_fq, p_pop)"
Need Help Inserting Data From VB To MySQL
I have my connection established in the variable conn.
Ok, so I have this:
username = InputBox("User's username?", , "Username", 500, 500)
upassi = InputBox("User's password?", , "Password", 500, 500)
amt = InputBox("Amount user donated?", , "Amount Donated", 500, 500)
conn.Execute "INSERT INTO insiders VALUES (NULL, " + username + ", " + upassi +", " + amt)"
I know I HAVE to be doing something wrong b/c it says I have a syntax error. The thing I need help with is inserting these variables into the table. I have no problem doing this without using variables, but I'm not sure how to do it with variables
Any/all help will be most appreciated
Inserting Data Into The Database Through VB
Dear guyz, I really appreciate your help b4. However, I still have some confusions:
1. Let say I have 2 tables named tableA and tableB
tableA(Matrix Number, Student Name, Gender)
primary key: Matrix Number
tableB(ID Number, Matrix Number)
primary key: ID Number
foreign key: Matrix Number
My problem are:
- If I want to add new records from VB into the database, which one I must add first? tableA or tableB
- This is my coding to add the data. Plz correct me if Im wrong:
adotableA.Recordset.Fields("Matrix Number").Value = txtMatrixNum.text
adotableA.Recordset.Fields("Student Name").Value = txtStuName.text
adotableB.Recordset.Fields("ID Number").Value = txtIDNum.text
adotableB.Recordset.Fields("Matrix Number").Value = txtMatrixNum.text
2. What is the difference(s) between using:
adotableB.Recordset.Fields(<field name>).Value and
I have tried them both and both result the same
3. From if-else statement below, can I change them into select case statement?
If txtName.Text <> "" or txtName.Text <> "Mike" or txtID.Text <> "" or _
txtID.Text <> "#####" then
I have lot more questions, but I don't have enough time. Waiting for your reply soon. TQ so much
Collecting Data From One RTF Box And Inserting Into Another
My aim is to have the user input data into various rich text format boxes and then by clicking a command button for this text to be inserted into various places in an SQL paragraph in another RTF box.
e.g RTF_1 = results RTF_2 = 20
RTF_3 (SQL BOX) = show 'RTF_1'
where price = 'RTF_2'
the sql is incorrect here but this is just for ease of the example.
to an extent it works but it also inserts all of the font type and size etc, not just the text the user has entered. Does anyone know how to solve this problem?
Inserting Data Into Access DB
I'm new to all the is VB lark, and any help will be welcome.
I have set up a form from which I hope to update a DB. I have 3 textboxes (Txt1, Text2, Text3). I want to insert date into a table with corresponding columns.
I've managed to connect to the DB using ADO, and return data to a list box from one column using a select statemen.
Can somebody point me in the right direction re: inserting data.
Inserting Data Into Access DB W/VB6
I am developing a program with VB6 that will log events to an Access DB file. The "INSERT INTO..." statement has a syntax error, but I can't figure out where the problem is. I'm fairly new to VB, so please forgive me if it's something stupid.
'Create the new database file.
Set cat = New ADOX.Catalog
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & AlarmLogFileName & ";"
' Create a new table.
Set tbl = New ADOX.Table
tbl.Name = AlarmLogTable
tbl.Columns.Append "Index", adInteger
tbl.Columns.Append "Date", adDate
tbl.Columns.Append "Time", adDate
tbl.Columns.Append "Description", adVarWChar, 255
' Connect to the database.
Set con = cat.ActiveConnection
' Insert records.
con.Execute "INSERT INTO " & AlarmLogTable & " VALUES ('', " & _
"'" & Format(Now, "mmm dd, yyyy (dddd)") & "', '" & Time & "', " & AlarmText & " '')"
' Close the database connection.
Set con = Nothing
Set tbl = Nothing
Set cat = Nothing
Inserting Data Into Table
im trying to add to a table, what is stored in an array, i thought id do as follows:
rs!ID = txtID.Text
rs!FName = array.Value(0)
rs!MName = Myarray.Value(1)
rs!LName = Myarray.Value(2)
but cuming up wiv error "Argument not optional" for ".Value"
Inserting Data In EXE File
I need to insert some data into an EXE file, which my app will read... how can I do it in such a way that the computer won't want to run it, and it won't mess up the EXE?
Maybe I can put it at the beginning, and set the pointer in the header? How do I do that? I don't have any sound information, so I don't want to try it...
Inserting Data Into Outlook
I need some help on the Outlook. As I was only a beginner on VB, so i was lost. Please Help me... Pls..... =)
I need to update info like contacts , calender retrieve from DB and update to the user's ms outlook.
I have to let the user access thru the Net so i was required to use ActiveX.
I can retrieve the data frm DB using ActiveX but i don't know how to update to the Outlook.
i know need to use Outlook.Application..... but i was helpless coz i don't know how to use....
so Can u help??
Really appreciate it... =)
Inserting Data Into MSACCESS
Im trying to insert data into access. The table im inserting into is linked to two other tables. I keep getting the following error
You cannot add or change a record because a related record is required in Skill
Basically i am using the following query
strQuery = "INSERT INTO ProductSkills ([SkillNo, SkillAvg]) VALUES ('"
strQuery = strQuery & Skills(iCount).SkillNo(iCount) & "," & Skills(iCount).EmployeeScore(iCount) & "')"
it must be something to do with the SkillNo being a primary key in the Skill table. How do i get round this.
The values im inserting into the PorductSkill for SkillNo match the values from the Skill table
VB Inserting Data Through A Form
I am inserting data through a form and after that the form should get refreshed. This is not happening. Any suggestions as to what i should be doing.
Inserting Data And Going To New Form
My prob is that i have a Pkey which is an autonumber.
So when i insert values using a button, the value should be inserted and a new form should be refreshed, Now if the ID field( which is autonumber) is refreshed, it gives eror as it cant be null. WHat is the way that i can refresh it and get a new autoid.
Help With Inserting Data Into A Database
I have a vb form with various text boxes and I wan't to be able to Insert the data within these text boxes into my table. The code below will insert constant values. However, I need to replace these values with variable names..Does anybody know
the correct cyntax....Please
'dbs.Execute " INSERT INTO tablename " & "(FirstName,LastName) VALUES " & "('Harry', 'Washington');"
Inserting Data Into An Access DB
I just created code for creating a new db and would like to fill the db with
data that I am extracting from a text file via textstream input. Does
anyone have a sample code thay would like to share for inputing data into an
Access Database? The versions I am running are VB 6.0 and Office 97.
Thank you ........
Mutual of Enumclaw Insurance Co.
Inserting A Data In A Blank Raw
Am trying to creat a hotel reservation project and i have created a table in access and this table has 40 maximum numbers. This table has Custname, RoomNumber, datein and dateout fields. Is there way i can use vb code so that if it reaches that dateout the name of the customer, datein and dateout gets deleted leaving RoomNo undeleted, and if i can just insert the name of the customer in a blank row.
i will be very greatfull if you help me
Inserting Data From VB To Excel
please anybody give me a small example programm where in i insert values from VB into excel sheet.
i give values in VB example 3 textboxes and click ok
this ok should execute Excel sheet and overwrite these values in particulat cells
cell D1 = Text1.text
cell H1 = Text2.text
cell R1 = Text3.text
how can we define this
Thanks in advance for ur help.
Text Box Value Is Not Inserting Into The Data
I am using vb 6.0 , ORACLE 8.1.7 & win 2000 in my home
I am trying to insert values in the table. following is the code I wrote
my form has 2 mask edit box for Phone & fax (and mask property is set to ####### (7), other are text boxes)
Private Sub cmd_frm_wing_profile_dd_Click()
' create a connection object
Dim oconn As New ADODB.Connection
oconn = "Provider=OraOLEDB.Oracle;" & _
"Data Source=tps;" & _
"User Id=system;" & _
oconn.ConnectionString = oconn
Dim qry As String
MsgBox "id " & txt_frmwp_wingid
MsgBox "prin " & txt_frmwp_principal
MsgBox "cont " & txt_frmwp_controller
MsgBox "email " & txt_frmwp_emailadd
MsgBox "ph " & msk_frmwp_phone
MsgBox "fax " & msk_frmwp_fax
MsgBox "name " & txt_frmwp_blockname
qry = "insert into wing (wing_id, principal_name, controller_name, email_add, phone_wing, fax_wing) values (' " & txt_frmwp_wing_id & " ' , ' " & txt_frmwp_blockname & " ' , ' " & txt_frmwp_principal & " ' , ' " & txt_frmwp_controller & " ' , ' " & msk_frmwp_phone & " ' , ' " & msk_frmwp_fax & " ')"
Dim inscom As New Command
.ActiveConnection = oconn
.CommandType = adCmdText
.CommandText = qry
If I check the value of the txt_frmwp_wing_id at line shown in red it shows me the contents that I entered, but the when it comes to the line shown in blue it shows me that txt_frmwp_wing_id is empty.
how can I resolve this error
follwing is the structure of my table
Create table wing
( wing_id char(2),
principal_name varchar2(40) not null,
controller_name varchar2(40) not null,
phone_wing char(7) not null,
fax_wing char (7) not null,
constraint wing_wing_id_pk primary Key (wing_id)
Inserting Data Into Access
I have a strange problem. I have a table in MS Access with 2 fields. I have bound this table to text fields in the form. Now the problem is if the table is empty, when I run the program and enter something in the textbox and press tab to go to the next textbox, whatever written in textbox1 disappears same with textbox2. But if there is even one row in table, then everything works fine. Did anybody get this type of problem. Any help is appreciated.
Inserting Data To Database
is it possible to insert the caption of an array of labels into an access db at the same time using Sql?
my code is:
Dim cnCandidates As Connection
Private Sub cmdAdd_Click()
'add a new candidate
Dim stSql As String
Set cnCandidates = New Connection
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "A:Candidates.mdb"
stSql = "INSERT into tblCandidate(Candidate_Name) " & _
" Values (lblName(0).caption)"
Inserting Data In To List Box
how do i assign code to a specific field in a list box
eg if the list box is called listbox1 and there are 2 fields in the list box file1 and file2. I want to assign them to load a specific windows media file, so that when selected, only the play button is needed to start.
Inserting Data Into Database
I doing a project on online exam. There are two tables question table and subject table(Access database). In the subject table there are two fields sub_id and sub_name. In the question table there is sub_id field. In the dataentry screen there is a combo box of subject name. I want that while data entry when the user selects the subject name from the combobox the corresponding subject id should be entered in the question table.
I will be thankful if some one could suggest some code to solve the above query.
Inserting New Rows Of Data Into Excel From VB
Hi all - New to VB and am a bit stuck
A bit of background, I have set-up a VB form that is activated from a PowerPoint slide. The form allows a user to task using outlook, the thing is I want all the information from the form not only tasked to an individual, but also copied to Excel for recording.
Now I can get this to happen, but I cant figure out how to tell excel to insert a new line and then paste the data from my form into the applicable cells, also I am having trouble trying to get the Spreadsheet to save. The thing is the spreadsheet will need to be shared, so I want VB to Paste to the Spreadsheet, and then I want it to save so it can be opened by other users who will fill in the missing data.
I can get the data into Excel, but it keeps overwright the same line.
Hope you can help
Inserting Data From Userform Into Cells
I have made a little program that is reading data from the serial port into a textbox of my userform in excel, and now I need to insert the data in a cell of sheet1. How can I insert the data from my textbox into for example in cell B4??
Inserting Data Into Web Forms In A Vb Form
OK, basically, I have a form with a web browser in it. What I want to happen is this:
I want to enter a url, I want the web browser to go to the page, then I want to program the program so that it enters certain data into the forums on the webpage, then submit the details.
So far, I have the web browser, its goes to the url I want, I just don't know where to start when it comes to entering the data into the forms on the page, then simulating a person hitting the submit button.
all help appreciated.
Inserting Data Into Access From Vb6 (a Date)
i know your suposed to use # around the dates when inserting into access but its giving me an error and i cant figure out why. If I comment out the lines that are in bold it works fine so I know its has to be with the date, anyone see a problem?
strSql = "INSERT INTO DriverTracking "
strSql = strSql & "(DriverName"
strSql = strSql & ", DateTime"
strSql = strSql & ", Longitude"
strSql = strSql & ", Latitude"
strSql = strSql & ", City"
strSql = strSql & ", State"
strSql = strSql & ", TruckNumb"
strSql = strSql & ", TerminalNumber"
strSql = strSql & ", Division"
strSql = strSql & ") "
strSql = strSql & " VALUES ("
strSql = strSql & "'" & strTextName & "'"
strSql = strSql & ", #" & strTextDate & "#"
strSql = strSql & ", '" & strTextLongitude & "'"
strSql = strSql & ", '" & strTextLatitude & "'"
strSql = strSql & ", '" & strTextCity & "'"
strSql = strSql & ", '" & strTextState & "'"
strSql = strSql & ", '" & strTextTruckNumb & "'"
strSql = strSql & ", '" & strTextTermNumb & "'"
strSql = strSql & ", '" & strTextDivision & "'"
strSql = strSql & ")"
Prob In Inserting Data Into Table
Hi, i got a prob in inserting data into tbl, can anyone help me 2 debug my error?
mSQl = "SELECT FMNHDB_CALL_ASSIGNMENT.CALL_KEY, FMNHDB_CALL_ASSIGNMENT.DISTRICT, FMNHDB_CALL_ASSIGNMENT.RECEIVED_DATE, FMNHDB_CALL_ASSIGNMENT.COMPANY_NAME, FMNHDB_CALL_DETAIL1.CALLER_NAME, FMNHDB_CALL_DETAIL1.CALLER_PHONE, FMNHDB_CALL_DETAIL1.CUST_ADDRESS_1, FMNHDB_CALL_DETAIL1.CUST_ADDRESS_2, FMNHDB_CALL_DETAIL1.CUST_ADDRESS_3, FMNHDB_CALL_DETAIL1.CUST_ADDRESS_4, FMNHDB_CALL_DETAIL1.CUST_ADDRESS_5, FMNHDB_CALL_DETAIL2.PRODUCT_LINE, FMNHDB_CALL_ASSIGNMENT.ENG_REPAIR_TYPE FROM (FMNHDB_CALL_ASSIGNMENT INNER JOIN FMNHDB_CALL_DETAIL1 ON (FMNHDB_CALL_ASSIGNMENT.CALL_KEY = FMNHDB_CALL_DETAIL1.CALL_KEY) AND (FMNHDB_CALL_ASSIGNMENT.RECEIVED_DATE = FMNHDB_CALL_DETAIL1.RECEIVED_DATE)) INNER JOIN FMNHDB_CALL_DETAIL2 ON FMNHDB_CALL_ASSIGNMENT.CALL_KEY = FMNHDB_CALL_DETAIL2.CALL_KEY WHERE FMNHDB_CALL_ASSIGNMENT.ENG_A_OR_B_FLAG='A' and ("
DoCmd.RunSQL ("Insert Into Tbl_DataNeeded " & mSQl)"
Inserting Data Into A Text File
Is there a way to "insert" a line of data (string variable) at the top of a text file that already contains data. I have a text file with over 500 lines of customer information and I need to insert 1 line at the top of the file that is non customer information.
Inserting Data Into Db Gives Run-time Error
I'm trying to insert a new record but I get this message:
Run-time error '-2147467259 (80004005)':
[Maximizer][ODBC Driver][Btrieve Database]
Related_To_Id+Related_To_Number (Client_Id+Contact_Number) NOT found in table COMPANY or PEOPLE (Rcode:431) (Ecode:-4458)
Through the messagebox, the query looks like this:
INSERT INTO Related_Entries (Related_To_Id,Related_To_Number,Related_From_Id,Related_From_Number," Desc") VALUES ('040603005910960349966C','0','040603005910960349966C','2','dealer');
What happens is that whatever Related_.._Id and Related_.._Number I use, there's an automatic check if the ID's exist in either the COMPANY or PEOPLE table.
This error sais it can't find it but the ID's shown in the string ARE correct.
I manually searched the DB and they're in there.
My guess is that the problem is located elsewhere.
Here is the code:
Dim strUpdate As String
strUpdate = "INSERT INTO Related_Entries (Related_To_Id," & _
"Related_To_Number,Related_From_Id," & _
"Related_From_Number,""Desc"") " & _
"VALUES ('" & objMaxRec.GetFieldValue("IDentification") & "'," & _
"" & objMaxRec.GetFieldValue("Contact_Number") & "," & _
"'" & dgContacts.Columns(3) & "'," & _
"" & dgContacts.Columns(4) & "," & _
"'" & relationType & "');"
Dim updateConnection As New adodb.Connection
updateConnection.Open "DEMElocal", "MASTER", "cheers"
Dim updateCommand As adodb.Command
Set updateCommand = New adodb.Command
.ActiveConnection = updateConnection
.CommandText = strUpdate
.CommandType = adCmdText
updateCommand.Execute , , adExecuteNoRecords
Thanks a lot for your time,
Access: Inserting Data Into A Form
I have a form (Form Returned), and I have a fields on it that when a button is pressed, it runs a query and brings that data into the form from existing tables.
The problem is finding a way to bring the data in.
I get a Syntax Error on the INSERT INTO line.
So far, i have:
Dim ptpimsno As String
Select Case Me.FormTypeSelect.Value
Case Is = "Baseline"
ptpimsno = Me.Searchbox.Value
strSQL = "INSERT INTO [Forms]![Form Returned] ( [Patient Surname], [Patient Forename] )" & _
"SELECT [Baseline Tracking].[Patient Surname], [Baseline Tracking].[Patient Forename]" & _
"FROM [Baseline Tracking]" & _
"WHERE ((([Baseline Tracking].[PiMS No])='" & ptpimsno & "'));"
Case Is = "Review 1"
ptpimsno = Me.Searchbox.Value
strSQL = "INSERT INTO [Forms]![Form Returned] ( [Patient Surname], [Patient Forename] )" & _
"SELECT [Review Tracking 1].[Patient Surname], [Review Tracking 1].[Patient Forename]" & _
"FROM [Review Tracking 1]" & _
"WHERE ((([Review Tracking 1].[PiMS No])='" & ptpimsno & "'));"
I have a feeling INSERT INTO doesn't work on forms.
Can anyone suggest another way to do this?
Inserting Image Into Data Report
I have a table named "tblAgent" :
agentId | pic1 | pic2 | pic3
A00001 | 1.jpg | 2.jpg | 3.jpg
A00002 | 4.jpg | 5.jpg | 6.jpg
A00003 | 7.jpg | "none" | "none"
I create 3 RptImage named "Image1", "Image2" and "Image3". Then, i create a DataEnvironment1 to connect the database and also create a DECommand "Command1" to select all from the tblAgent.
Then, i write this code into the data report but it's not work ?
Private sub DataReport_Initialize()
Image1.picture = loadPicture("C:image" & DataEnvironment1.rsCommand1.Fields(1))
Image2.picture = loadPicture("C:image" & DataEnvironment1.rsCommand1.Fields(2))
Image3.picture = loadPicture("C:image" & DataEnvironment1.rsCommand1.Fields(3))
I tried int DataReport_Activate() and others, but still not functioning ? Do anyone know how to insert the images into data report using this way ? Please help me.
Inserting Data Into SQL SERVER 2000
Am selecting data from multiple Access table and am then inserting that data into a SQL Server 2000 database. The total no. of records is 207,542 at the current time, but that will grow substantially as time goes on. Now to insert the data into the SQL Server database i am using a do while loop, its working grand till i get to records around the 32-33,000 mark where i get an the following error: "6 overflow" no i am using an int to keep track of what record number i am on, could it be the int is tool small and that i should be using a long???
Inserting Data Into Access Database
If I have a form with some text boxes which is linked to a database, if I want to save the text box values into the database how can I do that ?
Inserting Data Using DataGrid Control
On a form, I have a combo box and a data grid.
Based on user's select in the combo box, data grid displays certain data which is supplied by stored procedure.
dataGrid.dataSource = rsStoredProc
Thats how my dataGrid gets it data. I have set the AllowUpdates, AllowInsert, AllowDelete properties of the dataGrid to TRUE. But still there is no additional row on the dataGrid for the user to add data, neither can the user edit or delete.
What is wrong here. Please suggest.
thank you in advance!