Forms talking to Microsoft SQL Server

I have a form that is based on an Oracle database. DML is handled by forms and the oracle database.
I have on field that takes a ticket number. When this field is filled out I want to connect to a Microsoft SQL Server and make sure that the ticket number references a real ticket.
In the validation trigger, how do I connect to a microsoft sql server, run a sql statement, test the results?

Here I give you a Oracle sample to access ACCESS DB by OCI, hope this will help you to SQL SERVER.
How to query an MS Access database using an OCA ODBC connection?
Note: This article makes reference to directories relevant to Forms 6i
Solution Description
====================
1. Attach the oca.pll, located in the %ORACLE_HOME%/oca60/plsqllib directory,
to the desired fmb.
For this directory to appear the Oracle Open Client Adapter Component
needs to be installed from the base Developer 6i R2 cd.
2. Write a program unit similar to the following:
FUNCTION get_access RETURN pls_integer IS
connection pls_integer;
cursor1 pls_integer;
stmt varchar2(1000);
n pls_integer;
BEGIN
stmt := 'select count(*) from emp';
connection := oca.dbconnect('scott/tiger@odbc:msa');
message(to_char(connection));
cursor1 := oca.execute(connection,stmt);
loop
begin
oca.fetch_row(connection,cursor1);
oca.coldata(connection,cursor1,1,n);
message(to_char(n)||' record(s)');
exception
when no_data_found then
message('NO MORE ROWS');
exit;
end;
end loop;
oca.close(connection,cursor1);
oca.disconnect(connection);
return n;
exception
when oca.connection_error then
message('OCA-Connection error');
when oca.cursor_error then
message('OCA-Cursor error');
when others then
message('Other Error');
end;
References:
%ORACLE_HOME%\tools\doc60\us\oca_info.pdf
"Using Oracle Forms Developer, Oracle Reports Developer and the Oracle Open
Client Adapter to Access ODBC Data Sources

Similar Messages

  • Accessing Microsoft SQL Server Data by using Oracle Forms 9i

    I am currently working on a Project with Oracle Forms 9i at front end and Microsoft
    SQL server at back end. Could Any one please recommand me the STEPS to connect Oracle forms 9i application with SQL Server database.
    Thanks in Advance...
    M. Aamer Javaid
    Oracle Certified DBA
    [email protected]

    1). Is this functionality be added to Forms 10g or later products or it is obsoleted.
    There are no plans to add OCA functionality.
    2). Steps to connect Forms 9i natively by using Java Importer.
    You will need to write some Java to connect to your source, perform the operations you want to do, and return that data to Forms. Doing this, though, means that you may lose the transaction management functionality that Forms provides for you.
    I cannot tell you what Java to write. It depends on your source and what you want to achieve. As for how to use the Java Importer, this is in the Forms documentation and there are papers on the Forms page on OTN.
    3). Any third party product that can conenct the both products natively.
    I don't know of any.
    Regards,
    Robin.

  • Writing data to Microsoft SQL Server/Dat​abase

    Hi All
    I have written a program in LV ver 6.1 that carries out various functional tests and at each test gathers 3 data values. At the moment the data is gathered at each stage of the test and written in a concatenated string to a file that was opened at the start of the test routine. What I need to do is output the data such that it is compatable with SQL server (presumably in some form of table?). I have read previous posts but they recommed the ni database toolkit, which I do not have. Should I be using the XML vi to take the string of data or use the active x vi? I have read in other posts that you can manage without the ni database toolkit but would need to program a database structure. My knowledge of database development is nil and I wondered if there was a vi that could be used that would create tables that could be directly interpreted by MS SQL?
    Labview Version 8.5
    Labview Version 8.6
    Labview Version 2013

    I'm having trouble understanding exactly what you're doing, but I will try to explain a few things:
    Ideally code written for database connectivity should not be included in my Labview code or problems could occur if my client changed his servers , database structure etc.
    The code can be yours. If you do write it, just make sure to create subVIs, so that if the DB structure does change (something which is rare), you will only need to change the code inside the subVIs.
    Microsoft SQL server is an intermediate piece of software that allows my Labview code to access the database without actually 'seeing' it. With my client using SQL server they can modify the way my Labview code sends data to their database if they decide to change their servers, database structure etc.
    SQL Server is the DB management system. It holds all the tables, queries, etc. and is responsible for actually managing the DB itself.
    What Dennis suggested was that the DB guy will write something known as a "stored procedure" and that you will call it.
    In such a case, if the DB guy wanted to change something, he could just change the stored procedure and (if the change does not affect the interface), you do not have to change or rebuild your program. This is equivalent to the subVIs I described earlier, except in this case, the function is inside the DB itself.
    Another version of this is creating a table with SQL commands and assigning a name for each command. You load the SQL command from the table by name and execute it. This allows for changing the SQL command inside the DB without changing your application.
    ADO connectivity is used and the connection string is best located in the windows registry file. Presumably this option would give my client the most flexiblity? Is this the same thing as the .udl file?
    Basically, the scheme is like this:
    DB <-> DBMS <-> ODBC <-> ADO <-> Your Application
    This may not be perfectly accurate, but the concept is basically this - in Windows, you talk to ANY database from ANY program using the same interface - you call ADO functions which will be responsible for getting to the DB you want and you use SQL to issue the commands, since the basic SQL commands are supported by all DBs.
    To identify the DB, you use a connection string. This connection string can have all the data in it or it can point to an existing file (UDL or DSN) which holds the data pointing to the DB. Dennis suggested that when developing on your machine, you will use a file pointing to a local DB, but when deploying you will use a file of the same name which will point to the real DB. Your program will always go to the file and from there it will know which DB to go to.
    The only time when this should really matter to the client is during configuration (for example, if the DB was moved to a different machine). All the client needs to do is edit the UDL file to point at the new location of the DB.
    Again, the advantage of all this is that this is not part of your code and is done by programs which are built to handle it.
    It is more efficient to use the Parameterized database technique such as the example given in the 'logging example parameterized'
    I don't know how much this efficiency will be relevant in the speeds you need.
    In any case, as I said, my own preference is to create functional subVIs - for example, a VI which will accept data in my format and will be responsible internally for converting that data and putting it into the necessary tables.
    I have sent my client an outline of the data to be saved on their database, which at the moment comprises of 3 tables, the first has things like operators name, date, time, serial number etc ( 7 records, 3 fields) the second table has test reference (11 tests in total) with items such as fuel flow, fuel temp etc (11 records, 5 fields), Last table has 1 record and 6 fields. Unlike the Labview example each stage of the test can take up to 4 minutes to complete and if successfull the program moves on to the next stage of the test, saving the test results and if a PASS or FAIL occurred. The question I have is would it more efficient to save the results at the end of all of the tests or shold I connect to their database and save results as the tests progress?
    I can't say I understand this, but my suggestion would be to let the client decide in what format they want the data, since they're the ones who want it. Work with the DB guy to decide exactly what data you need to put into the DB and where and then you can decide exactly which functions you need. As said, you might want to let the DB guy write some stored procedures which you can use to input the data.
    Unless it's a large amount of data, writing to a DB is usually fairly quick (under a second). If it is relevant, my suggestion would be to write after each phase.
    In any case, I suggest you go through some real DB tutorials (not LV related) and see if you can wrap your head about it. I know I don't particularly like designing DBs (or PID) any more than you do, but it's a skill worth having, and in some places, a DB makes things easy and practical.
    Try to take over the world!

  • The SELECT permissions was denied on the object 'extended_properties', database 'mssqlsystemresource', schema 'sys'.(Microsoft SQL Server, Error:229

    I have a SQL Server connected intro a Windows Server 2003 Domain Active Directory, the server holds a default instance with a single Database, the SQL Server is 2005 Std Edition, and is using mix mode Authentification, then I able to create SQL Native Users
    and Invoque Windows Domain Users also.
    The Goal of this project is remove the sysadmin Server role for all the Windows Domain Users, to give then a more granular secure model but at the moment is this only way to connect at the Data Base Server.
    I already create Native SQL Servers users without any problem!, they respect Securable Setting, Server Roles, User Mapping, everything...Just when I create a Login Profile form a Domain Users and apply the same setting, I get this error...
    The SELECT permissions was denied on the object 'extended_properties', database 'mssqlsystemresource', schema 'sys'.(Microsoft SQL Server, Error:229)
    But if the user have sysadmin Server Rol he can sing over the server without any issue, I review the .sys view extended_properties and "Public" is the only Database Role placed.
    Any Idea if I need change any Setting in the Secure in SQL Master DataBase? or which is the issue witjh this matter?
    Thank in advance for your help!

    Since there are so many possibilities for what might be wrong.  Here's another possibility to look at.  I ran into something where I had set up my own roles on a database.  (For instance, "Administrator", "Manager", "DataEntry",
    "Customer", each with their own kinds of limitations)  The only ones who could use it were "Manager" role or above--because they were also set up as sysadmin because they were adding users to the database (and they were highly trusted). 
    Also, the users that were being added were Windows Domain users--using their domain credentials.  (Everyone with access to the database had to be on our domain, but not everyone on the domain had access to the database--and only a few of them had access
    to change it.)
    Anyway, this working system suddenly stopped working and I was getting error messages similar to the above.  What I ended up doing that solved it was to go through all the permissions for the "public" role in that database and add those permissions
    to all of the roles that I had created.  I know that everyone is supposed to be in the "public" role even though you can't add them (or rather, you can "add" them, but they won't "stay added").
    So, in "SQL Server Management Studio", I went into my application's database, in other words (my localized names are obscured within <> brackets): "<Computername> (SQL Server <version> - sa)"\Databases\<MyAppDB>\Security\Roles\Database
    Roles\public".  Right-click on "public" and select "Properties".  In the "Database Role Properties - public" dialog, select the "Securables" page.  Go through the list and for each element in the
    list, come up with an SQL "Grant" statement to grant exactly that permission to another role.  So, for instance, there is a scalar function "[dbo].[fn_diagramobjects]" on which the "public" role has "Execute" privilege. 
    So, I added the following line:   
    EXEC ( 'GRANT EXECUTE ON [dbo].[fn_diagramobjects] TO [' + @RoleName + '];' )
    Once I had done this for all the elements in the "Securables" list, I wrapped that up in a while loop on a cursor selecting through all the roles in my roles table.  This explicitly granted all the permissions of the "public" role to
    my database roles.  At that point, all my users were working again (even after I removed their "sysadmin" access--done as a temporary measure while I figured out what happened.)
    I'm sure there's a better (more elegant) way to do this by doing some kind of a query on the database objects and selecting on the public role, but after about half and hour of investigating, I wasn't figuring it out, so I just did it the brute-force method. 
    In case it helps someone else, here's my code.
    CREATE PROCEDURE [dbo].[GrantAccess]
    AS
    DECLARE @AppRoleName AS sysname
    DECLARE AppRoleCursor CURSOR LOCAL SCROLL_LOCKS FOR
    SELECT AppRoleName FROM [dbo].[RoleList];
    OPEN AppRoleCursor
    FETCH NEXT FROM AppRoleCursor INTO @AppRoleName
    WHILE @@FETCH_STATUS = 0
    BEGIN
    EXEC ( 'GRANT EXECUTE ON [dbo].[fn_diagramobjects] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT EXECUTE ON [dbo].[sp_alterdiagram] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT EXECUTE ON [dbo].[sp_creatediagram] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT EXECUTE ON [dbo].[sp_dropdiagram] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT EXECUTE ON [dbo].[sp_helpdiagramdefinition] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT EXECUTE ON [dbo].[sp_helpdiagrams] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT EXECUTE ON [dbo].[sp_renamediagram] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[all_columns] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[all_objects] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[all_parameters] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[all_sql_modules] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[all_views] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[allocation_units] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[assemblies] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[assembly_files] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[assembly_modules] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[assembly_references] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[assembly_types] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[asymmetric_keys] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[certificates] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[change_tracking_tables] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[check_constraints] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[column_type_usages] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[column_xml_schema_collection_usages] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[columns] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[computed_columns] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[conversation_endpoints] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[conversation_groups] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[conversation_priorities] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[crypt_properties] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[data_spaces] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[database_audit_specification_details] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[database_audit_specifications] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[database_files] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[database_permissions] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[database_principal_aliases] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[database_principals] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[database_role_members] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[default_constraints] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[destination_data_spaces] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[event_notifications] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[events] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[extended_procedures] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[extended_properties] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[filegroups] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[foreign_key_columns] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[foreign_keys] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[fulltext_catalogs] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[fulltext_index_catalog_usages] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[fulltext_index_columns] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[fulltext_index_fragments] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[fulltext_indexes] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[fulltext_stoplists] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[fulltext_stopwords] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[function_order_columns] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[identity_columns] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[index_columns] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[indexes] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[internal_tables] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[key_constraints] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[key_encryptions] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[message_type_xml_schema_collection_usages] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[module_assembly_usages] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[numbered_procedure_parameters] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[numbered_procedures] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[objects] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[parameter_type_usages] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[parameter_xml_schema_collection_usages] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[parameters] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[partition_functions] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[partition_parameters] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[partition_range_values] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[partition_schemes] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[partitions] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[plan_guides] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[procedures] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[remote_service_bindings] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[routes] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[schemas] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[service_contract_message_usages] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[service_contract_usages] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[service_contracts] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[service_message_types] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[service_queue_usages] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[service_queues] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[services] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[spatial_index_tessellations] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[spatial_indexes] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[sql_dependencies] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[sql_modules] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[stats] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[stats_columns] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[symmetric_keys] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[synonyms] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[syscolumns] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[syscomments] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[sysconstraints] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[sysdepends] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[sysfilegroups] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[sysfiles] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[sysforeignkeys] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[sysfulltextcatalogs] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[sysindexes] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[sysindexkeys] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[sysmembers] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[sysobjects] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[syspermissions] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[sysprotects] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[sysreferences] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[system_columns] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[system_objects] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[system_parameters] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[system_sql_modules] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[system_views] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[systypes] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[sysusers] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[table_types] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[tables] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[transmission_queue] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[trigger_events] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[triggers] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[type_assembly_usages] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[types] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[views] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[xml_indexes] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[xml_schema_attributes] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[xml_schema_collections] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[xml_schema_component_placements] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[xml_schema_components] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[xml_schema_elements] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[xml_schema_facets] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[xml_schema_model_groups] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[xml_schema_namespaces] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[xml_schema_types] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[xml_schema_wildcard_namespaces] TO [' + @AppRoleName + '];' )
    EXEC ( 'GRANT SELECT ON [sys].[xml_schema_wildcards] TO [' + @AppRoleName + '];' )
    FETCH NEXT FROM AppRoleCursor INTO @AppRoleName
    END
    CLOSE AppRoleCursor
    RETURN 0
    GO
    Once that is in the system, I just needed to "Exec GrantAccess" to make it work.  (Of course, I have a table [RoleList] which contains a "AppRoleName" field that contains the names of the database roles.)
    So, the mystery remains: why did all my users lose their "public" role and why could I not give it back to them?  Was this part of an update to SQL Server 2008 R2?  Was it because I ran another script to delete each user and add them back
    so to refresh their connection with the domain?  Well, this solves the issue for now.
    One last warning: you probably should check the "public" role on your system before running this to make sure there isn't something missing or wrong, here.  It's always possible something is different about your system.
    Hope this helps someone else.

  • Oracle forms 9i/10g connecting SQL Server

    I am currently working on a Project with Oracle Forms 9i at front end and Microsoft
    SQL server at back end. Could Any one please recommand me the steps to connect
    Oracle 9i application with SQL Server database.
    Thanks in Advance...
    M. Aamer Javaid
    Oracle Certified DBA
    [email protected]

    Follwoing is the soluton which I got from orafaq forum:
    <<<<<
    I'd go for an ODBC on the database server, using HSODBC. It worked quite well on a data warehouse project using OWB. I fail to see why it wouldn't work for Forms.
    MHE
    >>>>>
    Now I'm fully in a confused and frustrated state. Each person is saying different solutions for the problem. One person is saying to connect using ODBC driver while other is saying to connect JDBC driver. Actually which driver should I configure? Also no one is giving a clear picture for the problem.
    How can I get a detailed solution for this problem (with screen shots) which include step by step procedure to configure a driver?
    So, I would be pleased if you could please guide me with step by step procedure to get connected with Oracle Forms using SQL Server?
    Or atleast some reference site where I can find the same.
    Thanks.

  • Error with Forms6i accesing Microsoft SQL Server 7

    Hello every body, this is my problem:
    - Forms6i
    - OCA 6.0.5.35
    - Microsoft Sql Server 7.0
    I can access to SQL Server database with Oracle SQL*Plus release 8.0.6.0.0 with no problem. But developing a form when i try to
    create a new data block with the wizard
    i put the name of the table and when i push
    the "refresh" button i get this message:
    "FRM-10095 asertion failed" and no columns displayed.
    Thanks in advanced.
    null

    sandeepjava wrote:
    java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
    Add the mentioned class (or in this specific case, the JAR file with the mentioned class) to the classpath of your runtime environment and you're fine.

  • Microsoft SQL server 2012 express

     
    i recently downloaded ENU\x86\SQLEXPR_x86_ENU.exe and ENU\x86\SQLManagementStudio_x86_ENU.exe from microsoft SQL server 2012 from official download centre page. First i installed SQLEXPR_x86 (database engine) with mixed mode authentication, then i installed
    management studio with new installation option rather than selecting add new features.after both the successfull installation i learnt that in the object explorer, expanding database+system database+master i dont have a table option to create
    new tables as earlier found in sql 2005 and 2008 versions. in simple words i dont have a table designer to create table, i have to type the statments using query editor to create and do manipulations in the table. for your further help i want to
    tell you some related information:
    1.i tried to get the table option with ENU\x86\SQLEXPRADV_x86_ENU.exe and ENU\x86\SQLEXPRWT_x86_ENU.exe without installing management studio as studio is already present in these packages. but still the problem persist.
    2.i have windows 7 home basic installed on PC and windows 7 home premium on laptop both with service pack 1 with all the new updates.
    3.after installation of sql server 2012 service pack, i thought problem might get solved but no.
    i really need table designer feature.

    Hello,
    It is simple : in SSMS , after having connected to your SQL Server instance, you should see in the left panel a TreeView with the name of your instance. Right-click on the name of your instance .I n the context menu , click on Facets ( 12th item just above
    Start PowerShell ).You will open a new form labeled "View Facets" followed by the "full" name of your SQL Server. In the bottom left part , you should see view the connection string .Click on it.
    If the name of your database is master , it means that you are connected to the master database . The master database is a system database in which you are not allowed to create a new table ( it is an essential database containing information essential to
    the survival of your SQL Server ).See this link ( even if it was for SQL Server 2012, it is always valuable )
    http://www.mssqltips.com/sqlservertip/1420/sql-server-system-databases/
    I would suggest to have a look at this link :
    http://msdn.microsoft.com/en-us/library/ms187837.aspx ( special 2012 ) and especially the part recommendations.
    As you have not yet created an user database , you connect automatically to the master database which is at least dangerous when you want to create a new table.
    You have before to create a new database in which you will create your new table. It is what I have explained in my former post.
    If you don't know how to create a new database, you have not posted in the good forum ( a curious habit from the original posters , maybe because they don't understand how to find the "good" forum but I recognize that I am often hesitating before finding
    the most appropriate forum even if I am moderator since 6 years ). It is possible that I have not been clear enough but English is not my mother tongue ).
    So don't hesitate to post again to obtain more help and explanations : this forum is full of highly-qualified persons always ready to help persons lost in SQL Server.
    For me , you have 2 important steps :
    - create a new database
    http://msdn.microsoft.com/en-us/library/ms176061(v=sql.120).aspx
    http://msdn.microsoft.com/en-us/library/ms186312(v=sql.120).aspx
    - create a new table
    http://msdn.microsoft.com/en-us/library/ms174979.aspx
    According to me , it is simpler to create a new database or/and table without using TRANSACT-SQL through the visual interface of SSMS
    for a database : right-click on the Databases node of your SQL Server instance and click on Create Database
    for a table : as soon as you have created your database , its name should appear in the list under the Databases node.
    Click on the little + on the left of this name to expand the node related to this new database.
    Right-click on the Tables node and choose New Table. You should arrive to a new form making relatively easy the creation of the table , more exactly , the structure of the table with its columns ( names and data types ).
    Don't hesitate to post again if you need more help( it is what I am doing when I am lost ) : you will find always someone available to help you at any time as moderators/answerers are nearly from every continent at any hour of the day ( when USA is sleeping
    , Europe and Asia are awake ... )
    Have a nice day
    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.

  • Connecting Forms 6i to MS SQL Server

    Dear friends,
    I am really struggling to solve this connection issue. I am working with forms 6i, oracle 8i, in Windows 2000 professional environment. Developing programs using oracle 8i tables is ok, but I want to connect to SQL Server 2000 and MS Access also, as I want my application to run on any of the back end databases. The things I have done are
    - I have already tables in MS SQL Server database.
    - I Installed ODBC for Microsoft and Oracle. I am able to connect to SQL Sever database using SQL Plus from Oracle ODBC, with the following string
    USERNAME/PASSWORD@ODBC:<DSN NAME>:<DATABASE NAME>
    - I also installed OCA for developer from the CD.
    I have followed the instructions in Developer Help menu and I was able to connect through SQL Plus, although it gives some error message while connecting and also while disconnecting. But I am not able to connect the same through Forms 6i. While using the same connect string with Forms 6i, gives an unknown error 'I'. I will appreciate if anyone provide me some tips. Thanks in advance.
    Best Regards
    Amit Tamrakar

    No there are no entries required in the TNSNAMES.ORA
    When you are using ODBC for connection, Oracle does not look fo rany enteries in TNSNAMES.ORA file.
    Now I am able to connect to both SQL Plus and Forms 6i. But while connecting to SQL Plus its giving an error
    Error accessing PRODUCT_USER_PROFILE
    Warning: Product user profile information not loaded!
    You may need to run PUPBLD.SQL as SYSTEM
    Server not available or version too low for this feature
    Connected to:
    Oracle Open Client Adapter for ODBC 6.0.5.35.0
    Microsoft SQL Server 08.00.0534
    Also while disconnecting the Windows Program Error comes, and the application closes abruptly.

  • Can I use Microsoft SQL Server Management Studio version 11.0 to write SQL queries for "SQL Server Compact 4.0 Local Database"

    Hi, Can I use Microsoft SQL Server Management Studio version 11.0 to write SQL queries for "SQL Server Compact 4.0 Local Database" ?
    When I use Connect Object Explorer, the "Connect to Server" dialog box which pops up has only 4 selections in the Server Type Drop Down List. They are Database Engine, Analysis Services, Reporting Services & Integration Services. I have read
    somewhere that there should be a compact database option. but I do not see it.
    What I would like to do is use free form SQL Queries against the tables in "SQL Server Compact 4.0 Local Database" .
    Once I have validated these queries, then I will use them in my Visual Studio 2012 C#, ASP.NET application. I created the Local Database using Visual Studio 2012 for use by my application.
    Thank you for your help..
    diana4

    Hello,
    With SSMS 2005 we have had the Option to work with SQL CE database files, but not with higher Version of SSMS.
    You can use the free SQL CE Toolbax instead; see
    http://sqlcetoolbox.codeplex.com/
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Error creating GTC to Microsoft SQL Server 2008

    I have a table in a Microsoft SQL Server 2008 data base.
    When I set the configuration of the connector I get and error.
    com.thortech.xl.gc.exception.DBException: The schema sipec does not exist in the target database.
    In the database performed the following query " select * from sipec.dbo.TABLE" and throws me results. But if I performed the following query “select * from sipec.TABLE” this brings me no results.
    So if in the field “Parent Table/View Name” I put this “sipec.dbo.TABLE” in the log file I see this error
    com.thortech.xl.gc.exception.DBException: The table name must be specified in the form of [Schema].[Table] or [Table]
    I put the driver where the guide indicate

    What is the solution?
    I have the same thing with SQL Server 2008 64 bit. When i switch my datasource from SQL 2008 to SQL 2000 it works great otherwise it will not work. I have checked SQL Server 2008 that all the ports show 1433. I have been stuck on this for a while. I also checked the SQL Server Network Configuration / TCP/IP and i have nothing in the dynamic field and all the ports show 1433. If someone has allready figured this out it would be good to have a solution- Especially since coldfusion is supposed to connect to the database....
    Thanks for any help.

  • Connection with Microsoft SQL Server version 7/2000

    Hello,
    I am a VB expert, but new in Oracle forms by starting from 6i.
    I am trying to get connected from oracle forms to Microsoft SQL server to get some data as batch job.
    Is some body can help me connecting to MS SQL Server, please.

    Hi,
    Create the odbc data source of SQL Server database and then while connecting through the Forms in the connection string write UserName/Password and host string as odbc:<odbc_Name>.
    Hope this will work.
    Regards
    gaurav

  • [Error] Microsoft SQL Server 2008 Setup. Error reading from file msdbdata.mdf

    Hi all
    I'm trying to install SQL 2008 Express on my Computer: Hp compact DX7300 Slim tower.
    and get this error:
    TITLE: Microsoft SQL Server 2008 Setup
    The following error has occurred:Error reading from file d:\8268cd7b247d294de359c9\x86\setup\sql_engine_core_inst_msi\PFiles\SqlServr\MSSQL.X\MSSQL\Binn\Template\msdbdata.mdf.  Verify that the file exists and that you can access it.
    Click 'Retry' to retry the failed action, or click 'Cancel' to cancel this action and continue setup.
    For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=10.0.1823.0&EvtType=0xF45F6601%25401201%25401
    Log file
    Overall summary:
      Final result:                  SQL Server installation failed. To continue, investigate the reason for the failure, correct the problem, uninstall SQL Server, and then rerun SQL Server Setup.
      Exit code (Decimal):           -2068643839
      Exit facility code:            1203
      Exit error code:               1
      Exit message:                  SQL Server installation failed. To continue, investigate the reason for the failure, correct the problem, uninstall SQL Server, and then rerun SQL Server Setup.
      Start time:                    2014-12-09 23:22:03
      End time:                      2014-12-09 23:40:28
      Requested action:              Install
      Log with failure:              C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20141209_232121\sql_engine_core_inst_Cpu32_1.log
      Exception help link:           http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=10.0.1823.0
    Machine Properties:
      Machine name:                  VISTA-PC
      Machine processor count:       2
      OS version:                    Windows Vista
      OS service pack:               Service Pack 1
      OS region:                     United States
      OS language:                   English (United States)
      OS architecture:               x86
      Process architecture:          32 Bit
      OS clustered:                  No
    Product features discovered:
      Product              Instance             Instance ID                    Feature                
                     Language             Edition              Version         Clustered 
    Package properties:
      Description:                   SQL Server Database Services 2008
      SQLProductFamilyCode:          {628F8F38-600E-493D-9946-F4178F20A8A9}
      ProductName:                   SQL2008
      Type:                          RTM
      Version:                       10
      SPLevel:                       0
      Installation location:         d:\8268cd7b247d294de359c9\x86\setup\
      Installation edition:          EXPRESS
    User Input Settings:
      ACTION:                        Install
      ADDCURRENTUSERASSQLADMIN:      False
      AGTSVCACCOUNT:                 NT AUTHORITY\NETWORK SERVICE
      AGTSVCPASSWORD:                *****
      AGTSVCSTARTUPTYPE:             Disabled
      ASBACKUPDIR:                   Backup
      ASCOLLATION:                   Latin1_General_CI_AS
      ASCONFIGDIR:                   Config
      ASDATADIR:                     Data
      ASDOMAINGROUP:                 <empty>
      ASLOGDIR:                      Log
      ASPROVIDERMSOLAP:              1
      ASSVCACCOUNT:                  <empty>
      ASSVCPASSWORD:                 *****
      ASSVCSTARTUPTYPE:              Automatic
      ASSYSADMINACCOUNTS:            <empty>
      ASTEMPDIR:                     Temp
      BROWSERSVCSTARTUPTYPE:         Disabled
      CONFIGURATIONFILE:             C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20141209_232121\ConfigurationFile.ini
      ENABLERANU:                    True
      ERRORREPORTING:                False
      FEATURES:                      SQLENGINE,REPLICATION
      FILESTREAMLEVEL:               0
      FILESTREAMSHARENAME:           <empty>
      FTSVCACCOUNT:                  <empty>
      FTSVCPASSWORD:                 *****
      HELP:                          False
      INDICATEPROGRESS:              False
      INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL Server\
      INSTALLSHAREDWOWDIR:           C:\Program Files\Microsoft SQL Server\
      INSTALLSQLDATADIR:             <empty>
      INSTANCEDIR:                   C:\Program Files\Microsoft SQL Server\
      INSTANCEID:                    SQLExpress
      INSTANCENAME:                  SQLEXPRESS
      ISSVCACCOUNT:                  NT AUTHORITY\NetworkService
      ISSVCPASSWORD:                 *****
      ISSVCSTARTUPTYPE:              Automatic
      MEDIASOURCE:                   d:\8268cd7b247d294de359c9\
      NPENABLED:                     0
      PID:                           *****
      QUIET:                         False
      QUIETSIMPLE:                   False
      RSINSTALLMODE:                 FilesOnlyMode
      RSSVCACCOUNT:                  <empty>
      RSSVCPASSWORD:                 *****
      RSSVCSTARTUPTYPE:              Automatic
      SAPWD:                         *****
      SECURITYMODE:                  <empty>
      SQLBACKUPDIR:                  <empty>
      SQLCOLLATION:                  SQL_Latin1_General_CP1_CI_AS
      SQLSVCACCOUNT:                 NT AUTHORITY\NETWORK SERVICE
      SQLSVCPASSWORD:                *****
      SQLSVCSTARTUPTYPE:             Automatic
      SQLSYSADMINACCOUNTS:           VISTA-PC\VISTA
      SQLTEMPDBDIR:                  <empty>
      SQLTEMPDBLOGDIR:               <empty>
      SQLUSERDBDIR:                  <empty>
      SQLUSERDBLOGDIR:               <empty>
      SQMREPORTING:                  False
      TCPENABLED:                    0
      X86:                           False
      Configuration file:            C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20141209_232121\ConfigurationFile.ini
    Detailed results:
      Feature:                       Database Engine Services
      Status:                        Failed: see logs for details
      MSI status:                    Passed
      Configuration status:          Passed
      Feature:                       SQL Server Replication
      Status:                        Failed: see logs for details
      MSI status:                    Passed
      Configuration status:          Passed
    Rules with failures:
    Global rules:
    Scenario specific rules:
    Rules report file:               C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20141209_232121\SystemConfigurationCheck_Report.htm
    I will very appriciate if someone can help me solve it. I was trying to set Full control for my account in Properties/Security of root folder and try again but error is still.
    Many thanks

    Hi Foreverduy,
    Before you run SQL Server 2008 express setup, make sure that you have installed Windows installer 4.5 and.NET Framework 3.5 SP1 manually. For more information about the process, please refer to the article:
    http://msdn.microsoft.com/en-us/library/ms143506(v=sql.100).aspx. Moreover, please turn off all the third-party softwares which could prohibit the installation process.
    According to your error message, the issue could be due to that your account has no rights to install SQL Server, or the corruption on the media.
    Firstly, please ensure that your account has admin rights. Also make sure that you right-click the setup.exe and choose “Run as administrator” to complete the installation.
    Secondly, please check if "msdbdata.mdf" file exists at d:\8268cd7b247d294de359c9\x86\setup\sql_engine_core_inst_msi\PFiles\SqlServr\MSSQL.X\MSSQL\Binn\Template. If it exists, please make sure that your account has read permission to the extracted
    folder.
    However, if the file doesn't exist in the extraction, the media could be corrupt. Please download the
    media
    again and check if the issue still occurs.
    Regards,
    Michelle Li

  • Create a table in SQL Server, Export tables from Microsoft Excel to Microsoft SQL Server, Populate the created table

    Hello team,
    I have a project that I need to do, what is the best approach for each step?
    1- I have to create a table in Microsoft SQL Server.
    2- I have to import data/ tables from Microsoft Excel or Access to Microsoft SQL Server. Should I use Microsoft Visual Studio to move data from Excel or Access?
    3-I should populate the created table with the data from the exported data.
    4-How should I add the second and third imported table to the first table? Should I use union query?
    After I learn these, I will bring up the code to make sure what I do is right.
    Thanks for all,
    Guity
    GGGGGNNNNN

    Hello Naomi,
    I have imported all the tables into SQL Server,
    I created a table:
    CREATE
    TABLE dbo.Orders
    Now I want to populate this table with the values from imported tables, will this code take care of this task?
    INSERT INTO dbo.Orders(OrderId, OrderDate)
    SELECT OrderId, OrderDate
    FROM Sales.Orders
    UNION
    SELECT OrderId, OrderDate
    FROM Sales.Orders1
    Union
    SELECT OrderId, OrderDate
    FROM Sales.Orders2
    If not, what is the code?
    Please advise me.
    GGGGGNNNNN
    GGGGGNNNNN

  • [Microsoft][SQL Server Native Client 11.0][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.  'Items' (OITM) (OITM)

    Dear Experts,
    i am getting the below error when i was giving * (Star) to view all the items in DB
    [Microsoft][SQL Server Native Client 11.0][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.  'Items' (OITM) (OITM)
    As i was searching individually it is working fine
    can any one help me how to find this..
    Regards,
    Meghanath.S

    Dear Nithi Anandham,
    i am not having any query while finding all the items in item master data i am giving find mode and in item code i was trying to type *(Star) and enter while typing enter the above issue i was facing..
    Regards,
    Meghanath

  • How to build a report in web Intelligence using Store procedure under Microsoft SQL Server 2000

    Post Author: ltkin
    CA Forum: WebIntelligence Reporting
    Hi,
    How to build a report in web Intelligence using Store procedure under Microsoft SQL Server 2000 ?
    Regards,

    Hi ltkin,
    Unfortunately, it is not possible in Xir2 to create Webi reports from stored procedures.
    Webi reports can only be created from Universe. So in Business Objects XIR3 we can create a special universe that enables Web Intelligence user's to access stored procedures residing in the database. This is the only way that Web Intelligence user's can access stored procedures.
    Please let me know if the above information helps.
    Regards,
    Pavan

Maybe you are looking for