Need help in writing a vbscript
Hi,
I need help in wring a vbscript. I have serached for the vbscript on the net, but could not find any.
I need to add a file to an msi using vbscript. - That's the requirement.
For this I have done the following with the help of vbscript.
1. With the insert statement I inserted a new copmonent in the FeatureComponent Table.
2. Now the next thing I did is, I inserted a new row in the File table using insert statement again. The file is uncompressed.
3. Since the file is a non-version file I also added a row in the MSIFileHash table.
4. Also, now added the Component in the component table.
After doing this I am able to see the chnages in the mst, however whrn I try to install it I get an error 2725 (Invalid database tables).
Can somebody please post a vbscript which can add a file to an msi?
Hi All,
Thanks for all your responses.
Yes, It is not so easy. I never said it was. Thanks for pointing out Orca. We use Orca on a daily basis.
What exactly I am looking at, is this.
We have some standard applications which needs to be repackaged every month. The repackaging process is same and does not change at least for these packages. So I was actually looking at automating these things.
What I did so far.
First we have created an object for Windows installer. I have then taken a copy of the original msi and then opened the database of this temporary msi database in transact mode. Once the database is opened we can use select, insert, update
and delete statements to update the database.
I could successfully add a registry to the msi. The component was also added successfully to the component table. I also could make changes to the Property table.
The tricky part comes with the addition of file to the file table.
The addition of file requires the following steps.
1. Add a new row to the file table. This can be done with the Insert statement.
2. We then need to associate the file to a new component or any other component already existing in the msi. In my case I am creating a new component.
3. We then have to associate this components to a feature in the FeatureComponents table.
4. Since the file I am adding is a non-versioned file, a new row also has to be added to the MSIFILEHASH table.
I could see the changes that I have done using the mst. But when I try to install the msi with the mst, I get the error 2725. I checked everything. All the other steps except for the file addition works fine.
To check whether I am indeed right, I have did this.
Skipped the file addition part to the msi. Every other change that I make works and I am able to install the msi with the mst successfully.
For obvious security reasons I will not be able to share the vbscript with you. If you guys think, that this is not a right forum for this question, please let me know the right forum. I have been stuck with this issue from the past 6 months. Any help would
really be appreciated.
Similar Messages
-
Need help in writing data from JSP to excel
Hi ,
I need help in writing the data from JSP to excel.I somehow able to retrieve the data into excel but unable to get the required format.
For eg: The amount should be displayed in 0.00 format .when i am exporting it to excel it is displaying as 0 :( .
I am using the following code in JSP.
"out.print(amt + '\t');"
Would like to know if there is any otherway where in i can get my requirement.
Thanks
TomHi,
Try using format part of the JSTL tag libs.
Syntax :
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<fmt:formatNumber value="40" pattern="$#,##0.00"/>
I need help in writing the data from JSP to excel.I
somehow able to retrieve the data into excelHow do u convert the jsp to excel?
One way to convert the jsp page to excel, is to render it as an excel appl instead of html. Set the content type of the response to application/ms-excel.
response.setContentType("application/ms-excel")Hope this Helps.... -
Need help for writing extract program
hi
i need help for writing extract program to retriew data from legacy system.
i already developed bdc programs for me31k and me21.
my requirement is to write extract program s for those t.codes.
to retriew data from legacy system and stored in flat file.i need help with a java program. it is a program that allows the user to enter a student's GPA, number of extracurricular activities, and number of service activities. The user can not enter a gpa above 4.0 or below 0. The user can not enter a negative number for the number of both activities. If the student meets the following criteria: 1) GPA of 3.8 or above and at least one extracurricular activity and one service activity, 2) GPA below 3.8 but at least 3.4 and a total of at least three extracurricular and service activities, 3) GPA below 3.4 but at least 3.0 and at least two extracurricular activities and three service activities, the message "Scholarship candidate" should display. If the student does not meet the criteria above, then the message"not a candidate" should display. Can you help me, please?
You haven't posted ANY 'java program' for us to help with.
The forum is NOT a coding service. It is to help you with YOUR code.
Post the code you have written and SHOW us (don't just tell us) how you compile it and execute it and the results you get. Then we can help you with any problems you are are having.
If you need help understanding just what the program should be doing you need to ask your instructor to clarify the assignment. -
Hi,
Please help in writing a UDF for these fields in mapping, which I need for the object Iu2019m doing currently.
The fields are like this:
1) batch_no = "TRUNC((GetMaxObjid('x_txn_sap_parts')-POWER(2,28))/5000)+1",
2) lot_id = "TRUNC((GetMaxObjid('x_txn_sap_parts')-POWER(2,28))/500)+1",
3) How to use JDBC connection factory class in the UDF.
Some logic I can provide which I know i.e. Power (2, 28) means 2 to the power of 28 (2 multiplied 28 times), Trunc means truncate, X_TXN_SAP_Parts is a database table.The Target fields are Batch_no, lot_id & Objid.Actually, objid is mapped initially to a source field i.e. Object ID and in this function it is only being used for the calculation of the batch_no.
Thanks in Advance,
Sreedhar.Hi,
Following with my query I've tried to use this code but still I'm unable to execute the mapping.
import java.util.*;
import com.sap.aii.mapping.lookup.*;
import com.sap.aii.mapping.lookup.*;
DataBaseAccessor accessor = null;
DataBaseResult JDBCOutPayload = null;
String BusinessSystem="clarify_dev_bizsys";
//give your business system having channel name
String CommunicationChannel="JDBC_TO_CDEV";
//give your channel name
String InputPayload= " select X_TXN_PRE_SITE_XFACE.nextval from dual;";
//give your sql query
try {
Channel channel =
LookupService.getChannel(BusinessSystem,CommunicationChannel);
accessor = LookupService.getDataBaseAccessor(channel);
DataBaseResult resultSet = accessor.execute(InputPayload);
for(Iterator rows = resultSet.getRows();rows.hasNext();){
Map rowMap = (Map)rows.next();
Object cValue = rowMap.get("batchno");
//field name of field required , as in database
catch (Exception e) {}
finally {
if (accessor != null)
accessor.close();
result.addValue((String)cValue);
--> I don't know what are the parameters to be used and how to be used in the UDF because this is the first time I'm writing a UDF.
--> The problem in using this query is that both OBJID & BatchNo. are on the target side and the value for the OBJID is retrieved by a SELECT query from the database.
Kindly help me how to resolve this query of mine.
Thanks in Advance.
Sreedhar. -
Need help in writing a vbs script
I am very new to scripting and need help in scripting the following:
When the Windows 7 machine boots up or a user logs on (easy to do with GPO), I want to execute a script that starts some services
ONLY if the length of the computer name is less than or equal to 15 else it should exit. It has to be done in the background without any user interaction.
The script should be able to work for both x86 and x64 version of Win7.
Any help would be greatly appreciated.
Thanks in advance.
JD
JDHi,
I highly recommend that you skip VBScript and learn PowerShell instead. This is pretty trivial in PowerShell:
If ($env:COMPUTERNAME.Length -le 15) {
# Do stuff
# HINT: Look into Start-Service
Write-Host "Under limit: $env:COMPUTERNAME"
} Else {
# Do optional stuff
Write-Host "Over limit: $env:COMPUTERNAME"
(OT: jrv - happy? =])
If you must stick with VBScript for some odd reason, here's an example to get you started:
Set wshNetwork = WScript.CreateObject( "WScript.Network" )
strComputerName = wshNetwork.ComputerName
If Len(strComputerName) <= 15 Then
'Do stuff here when the name is short enough
WScript.Echo "Under limit: " & strComputerName
Else
'Do stuff here when the name is too long (only if you want to)
WScript.Echo "Over limit: " & strComputerName
End If
http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/services/
Don't retire TechNet! -
(Don't give up yet - 12,830+ strong and growing) -
Need help with some rules. I want to book a number to a specific Entity at a Specific Custom 4 only. I don't want this formula to work at all C4 levels. How can this be done?
for example if Entity is "XBM1123" and we use C4 for tracking and the tracking level I want to book it to is IMPORT, how can this be done for a specific account 4400221
I have my formula as
If pov_value = "<Entity Currency>" or pov_value = "<Entity Curr Adjs>" Then
If HS.Entity.Member = "XBM1123" or HS.Custom4.Member = "IMPORT" then
HS.EXP "A#4400221= A#4521111 + A#3526644 + A#635210"
End If
End if
this did not work. I got hte following error
Calculate started.<BR>Error executing VBScript Microsoft VBScript runtime
error, Line 259:Object doesn't support this property or method:
'HS.Custom4.Member'.<BR>Calculate finished.<BR>Error executing
VBScript %0.
I then changed it to the below and it still did not work
If pov_value = "<Entity Currency>" or pov_value = "<Entity Curr Adjs>" Then
If HS.Entity.Member = "XBM1123" then
HS.EXP "A#4400221.C4#IMPORT= A#4521111 + A#3526644 + A#635210"
End If
End if
error
Invalid Custom1 member
specified for this function.
Invalid Destination specified for this function:
A#4400221.C4#IMPORT.You are close.
Try:
If pov_value = "<Entity Currency>" or pov_value = "<Entity Curr Adjs>" Then
If HS.Entity.Member = "XBM1123" then
HS.EXP "A#4400221.C4#IMPORT= A#4521111.C4#IMPORT + A#3526644.C4#IMPORT + A#635210.C4#IMPORT"
End If
End if
or replace IMPORT with with Top_C4 or what ever member you need to copy to C4#IMPORT.
Rule of thumb, to be on the safe side and for most simple calcs, is if you mention a dimension on the left side, you need to define it on the right side as well. -
Need helping in writing query for finding percentage of duration
Can any one please help in writing query for this.
The table is like this :-
ID Region Month Duration
I1 R1 Jan 80
I2 R2 Jan 70
I3 R1 Jan 70
I4 R3 Jan 40
I5 R1 Feb 80
I6 R2 Feb 30
I7 R3 Mar 100
I want to write a query to find
% of duration for each and every region against each and every month.
Please help in solving this query. I am in urgent need of this.
Thanks in advance.I also have to do in MS Access 2003You also have to ask into an other forum since here it's an Oracle forum, to try to find Oracle solution.
Nicolas. -
Need help in writing NVARCHAR2 column to an excel sheet
Hi All,
I have a NVARCHAR2 column in my table. I want to store the data present in the column into an excel file. When i write the data to an excel file the data is getting converted to some other form. It's not in human readable form.
Language is not fixed for the column.
I need help in storing the NVARCHAR2 data into an excel file without any implicit conversion done by the oracle.
Please help.
Thanks,
Girish G
Edited by: Girish G on Jul 14, 2011 2:02 AMExport data to BLOB (csv)
-
Need help with writing a query with dynamic FROM clause
Hi Folks,
I need help with an query that should generate the "FROM" clause dynamically.
My main query is as follows
select DT_SKEY, count(*)
from *???*
where DT_SKEY between 20110601 and 20110719
group by DT_SKEY
having count(*) = 0
order by 1; The "from" clause of the above query should be generated as below
select 'Schema_Name'||'.'||TABLE_NAME
from dba_tables
where OWNER = 'Schema_Name'Simply sticking the later query in the first query does not work.
Any pointers will be appreciated.
Thanks
rogers42Hi,
rogers42 wrote:
Hi Folks,
I need help with an query that should generate the "FROM" clause dynamically.
My main query is as follows
select DT_SKEY, count(*)
from *???*
where DT_SKEY between 20110601 and 20110719
group by DT_SKEY
having count(*) = 0
order by 1; The "from" clause of the above query should be generated as below
select 'Schema_Name'||'.'||TABLE_NAME
from dba_tables
where OWNER = 'Schema_Name'
Remember that anything inside quotes is case-sensitive. Is the owner really "Schema_Name" with a capital S and a capital N, and 8 lower-case letters?
Simply sticking the later query in the first query does not work.Right; the table name must be given when you compile the query. It's not an expression that you can generate in the query itself.
Any pointers will be appreciated.In SQL*Plus, you can do something like the query bleow.
Say you want to count the rows in scott.emp, but you're not certain that the name is emp; it could be emp_2011 or emp_august, or anything else that starts with e. (And the name could change every day, so you can't just look it up now and hard-code it in a query that you want to run in the future.)
Typically, how dynamic SQL works is that some code (such as a preliminary query) gets some of the information you need to write the query first, and you use that information in a SQL statement that is compiled and run after that. For example:
-- Preliminary Query:
COLUMN my_table_name_col NEW_VALUE my_table_name
SELECT table_name AS my_table_name_col
FROM all_tables
WHERE owner = 'SCOTT'
AND table_name LIKE 'E%';
-- Main Query:
SELECT COUNT (*) AS cnt
FROM scott.&my_table_name
;This assumes that the preliminary query will find exactly one row; that is, it assumes that SCOTT has exactly one table whose name starts with E. Could you have 0 tables in the schema, or more than 1? If so, what results would you want? Give a concrete example, preferably suing commonly available tables (like those in the SCOTT schema) so that the poepl who want to help you can re-create the problem and test their ideas.
Edited by: Frank Kulash on Aug 11, 2011 2:30 PM -
Need help in writing coding in HTML?
HI All
I have requirement like this.
1st RFC i pass Plant and i will get trasportation point.
in display template i need to display trasportation point in dropdown box and user will select the trasportation point and iam passing this trasportation to aother RFC and gettting shipment cost.
i need help in how to write coding in .IRPT
i created the transactions for both the RFC and its working fine.First RFC iam getting trasportaion point ...i created Xecute query.
I need how to display !st one in dropdown box and pass that data into 2nd RFC.
Regards,
PhaniPhani,
You have to use the iBrowser displaytemplate.
Map the transportion point Xacute qquery in iBrowser displaytemplate.
In code use :
document.APP1.getBrowserObject().getSelectedItem();
Store the value of above code in a variable.
And pass this variable in other appalet which displays the R/3 details as below:
document.APP2.getQueryObject().setParam(1,var);
document.APP2.refresh();
-Suresh -
Need Help on writing Update Routines
Hi BW Experts,
I have a requirement to display data from Header and item datasource.From item datasource, i need to pull only 0MATERIAL.The Common fields for this datasource is service order number. I just want to pull 0MATERIAL from item datasource.So i am planning to write a routine to lookup the data from item datasource. But i have a small query on writing the Code.
Suppose if i write the code in Update Rules for header datsource and pulling the data for (LOOKUP of 0MATERIAL) 0material from Item datasource.Seems for One Service Order there are 5 to 6 materials. While writing the routine, how can i pull 5 materials to header datasource.
In Update rules, we are moving to RESULT. How can i pull 5 materials.
Can u pls help on this with the sample Code.
Thanks
JelinaHi
Re: Flat file extraction
Re: how to look up master data in update rule
Hope it helps -
Need help in writing a tricky sql/PL/Sql Procedure
Hi,
I have a Branch table with just two fields in it node1 and Node2, The table looks like this
node1 | node2
-------|---------
1 | 2
3 | 2
3 | 4
4 | 5
1 | 5
1 | 6
5 | 6
in the above data if you draw lines between node_1 and node_2 you will see that there are 3 different paths to get from 1 to 5, as follows
/--------6-------\
1----------------------5
\2------3-------4/
Now I need to Find all the nodes between 1 and 5 or all the possible paths from node 1 to node 5 in this case I have 3 possible paths they are as follows
1-2-3-4-5
1-3-5
1-5
Now I know if this data was stored in a hierarchical manner I can get the results i want by using CONNECT BY and SYS_CONNECT_BY_PATH.
Is there a way to transform this data into a hierarchcal manner so that I can use the CONNECT BY or can somebody give me an Idea as to how to write a PL/SQL procedure to get the result I want.
Any help will be greatly appreciatedHi!
1.Create another table Branch1 to hold 'transformed data'.
2.Use the following procedure to insert data into branch1 table.
declare
cursor n is select * from branch;
begin
for nrec in n loop
if nrec.node1 = 5 then
insert into branch1(node1,node2) values(nrec.node2,nrec.node1);
elsif nrec.node2= 5 then
insert into branch1(node1,node2) values(nrec.node1,nrec.node2);
else
if nrec.node2> 5 then
insert into branch1(node1,node2) values(nrec.node1,nrec.node2);
elsif nrec.node1> 5 then
insert into branch1(node1,node2) values(nrec.node2,nrec.node1);
elsif (nrec.node1 < nrec.node2 ) then
insert into branch1(node1,node2) values(nrec.node1,nrec.node2);
else
insert into branch1(node1,node2) values(nrec.node2,nrec.node1);
end if;
end if;
end loop;
commit;
end;
3.Then execute the following connect by query:
SQL> select lpad(' ',level*2,' ')||node1 from branch1
2 start with node1=1
3 connect by prior node2=node1;
Hope this is satisfactory.
Thanks! -
Need Help in Writing a program using a two-dimensional Array
I need to write a program that takes 16 integers as inputs and determine whether the square is a magic square(sum of each row, column, and diagonal is the same constant) and display the result in a message Box. Please Help!!!!!
stick the 16 ints in an int[4][4] and then just write the methods. i guess thats the hard part though. the most cumbersome and longest possible way to do it is just write everything out. ie if(int[1][1] + int[2][1] + int[3][1] etc...). a better way would be to use a bunch or for loops, but you'll have to figure that out yourself.
-
Need help in writing a .jsp page
Hi Guys,
I am new to JSP. My requirement is " I have a link on my webpage. When the user clicks that link, a HTML page is displayed which has parameters to be entered (for ex: from_date , to_date). When the user clicks the submit button, a jsp page should be displayed in which a query is run to display the output. For example, the user enters the from_date and to_date parameter values to know the employees employed within those dates in their company. The query is "select empname,empno,sal,dept,comm from emp where employed_date between from_date and to_date" . The following should run and display in the jsp page.
How can i write a .jsp to extract the parameters that are entered in the HTML form in to a .jsp and run the query with those parameters to display the output. Help needed in making me write this .jsp for this query.
Help Aprreciated.
ThanksHm, your requirements sound like homework assignment from classroom. If so, is itn't better that you find the answer youself? There are plenty of very relevant references for how to use jsp to handle html forms or talk to a rdbms through a jdbc connection. For example, for jsp and html forms, you can google "jsp html forms"; for jsp and sql query, search for "jsp jdbc".
Tell me if this is not helpful. -
Need help in writing a select query to pull required data from 3 tables.
Hi,
I have three tables EmpIDs,EmpRoles and LatestRoles. I need to write a select Query to get roles of all employees present in EmpIDs table by referring EmpRoles and LatestRoles.
The condition is first look into table EmpRoles and if it has more than one entry for a particular Employee ID than only need to get the Role from LatestRoles other wise consider
the role from EmpRoles .
Sample Script:
Create Table #EmpIDs
(EmplID int )
Create Table #EmpRoles
(EMPID int,Designation varchar(50))
Create Table #LatestRoles
EmpID int,
Designation varchar(50)
Insert into #EmpIDs values (1),(2),(3)
Insert into #EmpRoles values (1,'Role1'),(2,'Role1'),(2,'Role2'),(3,'Role1')
Insert into #LatestRoles values (2,'Role2')
Employee ID 2 is having two roles defined in EmpRoles so for EmpID 2 need to fetch Role from LatestRoles table and for
remaining ID's need to fetch from EmpRoles .
My Final Output of select query should be like below.
EmpID Role
1 Role1
2 Role2
3 Role1
Please help.
MohanMohan,
Can you check if this answers your requirement:
Create Table #EmpIDs
(EmplID int )
Create Table #EmpRoles
(EMPID int,Designation varchar(50))
Create Table #LatestRoles
EmpID int,
Designation varchar(50)
Insert into #EmpIDs values (1)
Insert into #EmpIDs values (2)
Insert into #EmpIDs values (3)
Insert into #EmpRoles values (1,'Role1')
Insert into #EmpRoles values (2,'Role2')
Insert into #EmpRoles values (2,'Role1')
Insert into #EmpRoles values (3,'Role1')
Insert into #LatestRoles values (2,'Role2')
--Method 1
select e.EmplID,MIN(ISNULL(l.Designation,r.Designation)) as Designation
from #empids e
left join #emproles r on e.emplID=r.EmpID
left join #latestRoles l on e.emplID=l.EmpID
group by e.EmplID
--Method 2
;with cte
as
select distinct e.EmplID,r.Designation,count(*) over(partition by e.emplID) cnt
from #empids e
left join #emproles r on e.emplID=r.EmpID
select emplID,Designation
from cte
where cnt=1
UNION ALL
select a.EmplID,l.Designation
from
(select distinct EmplID from cte where cnt>1) a
join #Latestroles l on a.EmplID=l.EmpID
order by emplID
Thanks,
Jay
<If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>
Maybe you are looking for
-
My home base computer has been authorized to play music my friend has downloaded from iTunes. I can upload that music to my iPhone and play it on the phone without any issue. When I am at work, I plug my iPhone into my computer and play music throu
-
Can't connect to computer in remote web access
I am running sbs 2011 essentials and have been able to remotely log in to the remote web access page. Once I get there I can see all the shared folders on the server (and access them) and I can also see the computers available for access (my compute
-
A friend and I shared an itunes account, as we both had ipod touches. I no longer have access to that account. I have created an account of my own but I need help tranferring the content that is on my ipod touch to my new itunes. I am scared to updat
-
What exactly do I need to do to set up wireless?
Please forgive me if I'm in the wrong section. I am totally new to all of this. I have comcast as an internet provider. I want to be able to use wireless internet on my MacBook Pro. What all do I need? I want to know from real people b/c it seemed li
-
Hi Friends, I want to print logical system id and system name. I am trying with sy-name , no result. Thanks