How to create a DSN-less connection to SQL Server for linked tables in Access

hey
i cant understand how i use that Function
if that information what you need
 stLocalTableName: dbo_user_name
stRemoteTableName: user_name
stServer :sedo2015.mssql.somee.com
stDatabase :sedo2015
stUsername :sedo_menf_SQLLogin_1
stPassword :123456789
how will be that Function??
please write that Function to me
'//Name : AttachDSNLessTable
'//Purpose : Create a linked table to SQL Server without using a DSN
'//Parameters
'// stLocalTableName: Name of the table that you are creating in the current database
'// stRemoteTableName: Name of the table that you are linking to on the SQL Server database
'// stServer: Name of the SQL Server that you are linking to
'// stDatabase: Name of the SQL Server database that you are linking to
'// stUsername: Name of the SQL Server user who can connect to SQL Server, leave blank to use a Trusted Connection
'// stPassword: SQL Server user password
Function AttachDSNLessTable(stLocalTableName As String, stRemoteTableName As String, stServer As String, stDatabase As String, Optional stUsername As String, Optional stPassword As String)
On Error GoTo AttachDSNLessTable_Err
Dim td As TableDef
Dim stConnect As String
For Each td In CurrentDb.TableDefs
If td.Name = stLocalTableName Then
CurrentDb.TableDefs.Delete stLocalTableName
End If
Next
If Len(stUsername) = 0 Then
'//Use trusted authentication if stUsername is not supplied.
stConnect = "ODBC;DRIVER=SQL Server;SERVER=" & stServer & ";DATABASE=" & stDatabase & ";Trusted_Connection=Yes"
Else
'//WARNING: This will save the username and the password with the linked table information.
stConnect = "ODBC;DRIVER=SQL Server;SERVER=" & stServer & ";DATABASE=" & stDatabase & ";UID=" & stUsername & ";PWD=" & stPassword
End If
Set td = CurrentDb.CreateTableDef(stLocalTableName, dbAttachSavePWD, stRemoteTableName, stConnect)
CurrentDb.TableDefs.Append td
AttachDSNLessTable = True
Exit Function
AttachDSNLessTable_Err:
AttachDSNLessTable = False
MsgBox "AttachDSNLessTable encountered an unexpected error: " & Err.Description
End Function

thanks more thanks for you
look i add that code in form
it worked but i cant add recored  why ??
Private Sub Form_Open(Cancel As Integer)
Call AttachDSNLessTable("dbo_user_name", "user_name", "sedo2015.mssql.somee.com", "sedo2015", "sedo_menf_SQLLogin_1", "123456789")
End Sub

Similar Messages

  • How to create a dsn less connection using a jsp

    hi,
    presently i have created a web site using jsp..i used a dsn connection to access the database.i used the basic jdbc:odbc type one driver..the issue is that when i tried to webhost my website they told me that i have to use a dsn less connection ....code anyone refer me the code as to how i could a dsn less connection jsp...i am using a access database..

    Well Friend,
    This is not the right form to post this query i would advice u to post this query in the JDBC thread
    If U are not satisfied with the resolution provided below
    Howevr as per my experience
    If U wanna use DSN less Connection U may go ahead and use TYPE II/III/IV drivers which would be Application(database) specific in general.
    u wud have to include the driver specific .jar files (to load drivers) in your classpath for few specific type of drivers like thin/OCI/.......
    And it wud be different for different Databases U can easily get information and downloadables about those drivers from db vendors web portals.
    Just for U reference check the links below
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm
    http://forums.oracle.com/forums/thread.jspa;jsessionid=8d92200830de37db8191784349ff8c14cef5a6d94e36.e34QbhuKaxmMai0MaNeMb3aTbxz0?messageID=901133��
    http://www.kitebird.com/articles/jdbc.html
    http://www.developer.com/java/data/article.php/3417381
    http://www.akadia.com/services/sqlsrv_jdbc.html
    http://www.thescripts.com/forum/thread182937.html
    Else where U can make use of Hibernate/ EJB/.....
    which would include support for Dbconnection internally.

  • How to create a DSN Less Connection using MySQL

    Hi All
    How to create a DSN Less Connection using MySQL?
    http://www.caucho.com/projects/jdbc-mysql/index.xtp and downloaded Caucho driver and installed the jar ---- caucho-jdbc-mysql-0.2.7.jar in my classpath..
    this is how i embedded the code
    try
    driver = (Driver) Class.forName("com.caucho-jdbc-mysql-0.2.7.Driver").newInstance();
    catch (Exception e)
    lastErr = "Cannot load the driver, reason:"+e.toString();
    nothing seems to work with code..
    Unable to proceed..Any piece of code would be of great help..
    Thanks and regds
    Gautam

    According to the installation instructions for that driver:
    The driver is com.caucho.jdbc.mysql.Driver
    The url is jdbc:mysql-caucho://hostname:port/database
    You used something else for the driver name. So it doesn't work. By the way, I found those instructions here: http://www.caucho.com/projects/jdbc-mysql/

  • Can't Create a Data Source - Failed to test connection. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied

    Hi there,
    I am having a serious issue with The Power BI Data Management Gateway which I am hoping that someone can help me with.
    Basically I am setting a connection between a Power BI demo site and a SQL 2012 Database based on Azure. The Data Management Gateway and is up and running, and Power BI has managed to connect to it successfuly.
    By following the tutorials at
    here I was able to successful create my Data Connection Gateway with a self-signed certificate.
    However, when trying to create the data source I come into problems. The Data Source Manager manages to successfully resolve the hostname, as per the screenshot below:
    Bear in mind that I exposed the require ports in Azure as endpoints and I managed to modify my hosts file on my local machine so I could access the SQL server hosted in Azure using its internal name -- otherwise I would not be able to get this far.
    However the creation of the data source also fails when trying to created it whilst logged in the SQL server in question:
    The Data Source Manager returns the error when using the Microsoft OLE DB Provider for SQL Server:
    Failed to test connection. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied
    I tried using the SQL Server Native Client 11.0 instead but I also get an error. This time the error is:
    Failed to test connection. Login timeout expiredA network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.Named Pipes Provider: Could not open a connection to SQL Server [53]. 
    Some considerations
    If I provide an invalid username/password, the Data Source Manager does say that the username and password is incorrect.
    Firewall is turned off in the SQL Server (either way, this error also happens if I try top use the Data Source Manager whilst logged in the SQL Server itself).
    SQL Profiler does not show any attempt of connection.
    The SQL server instance in question is the default one.
    The error happens regardless if I select the option to encrypt connection or not.
    In SQL Configuration manager I can see that all protocols are enabled (TCP/IP, Named Pipes and Shared Memory.
    The Event Viewer does not provide any further errors than the one I have copied in this post.
    I'm at a loss here. Could someone please advise what might I be doing wrong?
    Regards,
    P.

    Here is what I had to do to solve this issue:
    Basically I had to add the MSSQL TCP/IP port as an end-point in Azure. After I did that, then I was able to create the data-source. However, I was only able to authenticate with a SQL account, as any domain account would return me an error saying that the
    domain isn't trusted.
    What puzzles me here is how come the Data Source Manager would inform me that an account username/password was invalid, but it would fail/timeout if I provided valid credentials (!?!?!!?)

  • OLE DB or ODBC error: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied

    Hi,
    I have one client and one server.  In both hosts I created an OS-user named User1.
    The user have been given various role under the prefix SQLServer2005.
    The default instance of SQL Server and instance (background-process) of
    Analysis Service are also run under User1.
    I connected via Management Studio to Analysis Service directly in the
    server.  I set the permission to access Analysis Service to Everyone. 
    This means everyone should be able to use Analysis Service.  I have set
    ODBC data source to the server.  Testing was successful.
    I created a project to create a cube.  The tables are fairly small (total 300 MB, biggest one 290).
    On project setting (created at client) I set the server host as
    deployment target. I managed to deploy project when all I have are Data
    Source and Data Source Views.
    But on deployment I always failed.   The errors remain the same, begins with
    OLE DB error: OLE DB or ODBC error: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.; 08001.
    I have tried 4 combinations of Impersonation :
    (A) Use a specific username and password
      * in which I supply User1 and the password of User1
    (B) Use the service account
    (C) Use the credentials of the current user
    (D) Default
    Why is this? The server does certainly exist.  I think the error message is wrong.
    I have seen 3 posting that seems related.  One of them say the solution is giving the right impersonation, but gave no detail.  About the privilege, User1 are granted the role of
    SQLServer2005MSOLAP.  What is the solution?
    Thank you,
    Bernaridho

    I just had this problem and solved it by creating an alias in SQL Server Configuration Manager, as below:
    Scenario: My SQL server is accessible from the internet under my.domain.com, and from itself at ServerName. But the local network can't see itself through the router at my.domain.com, so the deployed project is unable to process the cube, since that would
    require Analysis Services to be able to see the SQL Server at my.domain.com, which it can't do.
    So I changed the server in my project from my.domain.com to ServerName, and I created a local alias to ServerName in SQL Server Configuration Manager, under SQL Native Client 11.0 Configuration, Aliases. In my case, I pointed it to localhost port 1333, and
    used SSH -L 1333:my.domain.com:1433, but I could have pointed the alias directly to the server, just as well. (Verifying... yes, that worked too, so you can forget SSH if you have no interest in it.)

  • [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

    I using SQL 2000 on Server 2012 in named instance. when i connect locally, it's ok, but when try to connect from network it generates error [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

    Hi Sayed Abdul Latif,
    As other post, SQL Server 2000 was out of support since April,2013. You can try to install SQL Server 2005 or later version. In addition, since the issue regards SQL Server Data Access. I will help you post the question in the related forums. It is appropriate
    and more experts will assist you.
    According to your description, you can only connect to SQL Server locally, I recommend you check if the TCP/IP and Named Pipes are enabled in SQL Server Configuration Manager. And the SQL Server is set to allow remote connection. Then restart the SQL Service
    and check if you can connect to SQL Server remotely.
    Additionally, we also need to verify if the SQL Server named instance is in a cluster, and connect to it by using the "servername\instancename" syntax, then you receive the above error message. If yes, you have to hardcode the TCP port or the Named Pipe
    of the SQL Server named instance. For more information, you can review the following article.http://support.microsoft.com/kb/888228/en-us
    Thanks,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • How to create a Model based on an SQL Server?

    Hello,
    Can someone please guide me how can I create a Model which takes it's Data from a table in an SQL Server?
    Can I make such a Model that will connect directly to a Datasource on the Application Server?

    Well Roy,
    I was also facing some similar problem, just now got my service displayed in portal. Thanks a lot that you could solve it urself. Anyway, now for using this service from another portal component do the following
    1. Add SharingReference value in Deployment Descriptor of the portal app from where u want to access this service
    example:
    <application-config>
    <property name="SharingReference"       value="com.customer.training.MyFirstPortalApp">
    </property>
    </application-config>
    2. Add libraries of the Portal Service (xxxapi.jar)
    in your par file u can see one jar file as <servicename>api.jar . extract this to some other location and in the client portal app project add this .jar to its build path.
    3. Write code to access the Portal Service
        a. Import package of the Portal Service
        b. Get instance of the Portal Service
        c. Call methods of the Portal Service
    example:IPortalRuntimeResources runtimeResources =      PortalRuntime.getRuntimeResources();
    IService aService = runtimeResources.getService("com.customer.training.MyFirstPortalApp.MyService");
    // OR
    IService aService = runtimeResources.getService(IMyService.KEY);
    // Cast the Service
    IMyService myService = (IMyService)aService;
    // call methods of the service
    response.write(myService.getWelcomeString(aName));
    thats how it should be...
    regards,
    Shubhadip

  • How to create a composite nonclustered index using sql server management studio

    Hi,
    How do I create a composite non clustered index using Manage Index and Keys dialogue box?
    sukai

    See image below:
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • Creating a datasource to connect MS SQL server

    I am using CF 7 and trying to create a datasurce to connect
    to my MS SQL server database.
    I get the following error when trying to create a Datasource:
    I have tried using the MS SQL server driver and also using
    Other
    I continue to get the error:
    java.sql.SQLException: [Macromedia][SQLServer JDBC
    Driver][SQLServer]Login failed for user 'trubel'. Reason: Not
    associated with a trusted SQL Server connection.
    The root cause was that: java.sql.SQLException:
    [Macromedia][SQLServer JDBC Driver][SQLServer]Login failed for user
    'trubel'. Reason: Not associated with a trusted SQL Server
    connection.
    Can anyone help me?
    Tim Rubel
    AIM: unixsyadm

    To set up Windows Authentication Mode security with
    Enterprise Manager in SQL Server:
    Expand a server group.
    Right-click a server, and then click Properties.
    On the Security tab, under Authentication, click Windows and
    SQL Server Authentication.
    See
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/instsql/in_runsetup_6p9v. asp
    Ted Zimmerman

  • "Access denied by Business Data Connectivity" on trying to connect to SQL server for creating external content type

    I was trying to create external client type but whenever I try to connect to Database server it is showing me error"Access denied by Business Data Connectivity". I have given the Secure Store Target Application ID coorectly and it is setup coorectly.
    In BDC service application I have given myself all the permissions( edit,execute,Selectable in clients,Set Permissions) through set metadata store permission option in it.
    Please suggest what other reason can be there for the error.
    Thanks and Regards
    Gaurav

    Hi Gaurav,
    If you have given your account all permissions through setting metadata store permission, the issue should be resolved.
    For a better trouble shooting , I suggest you do as the followings:
    1. Assign administrators to a Business Data Connectivity service application
    Here is a detailed article for your reference:
    http://technet.microsoft.com/en-us/library/ff973113.aspx
    2. You can try to recreate a Business Data Connectivity service application to test whether it works.
    http://www.dotnetcurry.com/showarticle.aspx?ID=794
    Best regards,
    Zhengyu Guo
    Zhengyu Guo
    TechNet Community Support

  • $$$$ License Exception when connecting to SQL Server for Weblogic 7.0

    Hi,
    I downloaded Weblogic 7.0, and installed and uninstalled a few times,
    When I tried to connect SQL Server 2000 using the samples in ..\examples\jdbc\mssqlserver4,
    I got the error:
    Exception was thrown: java.sql.SQLException: $$$$$$$$$$$$$$$$ License Exception
    $$$$$$$$$$$$$$$$
    jDriver/MSSQLServer4: license signature validation error!
    $$$$$$$$$$$$$$$$ License Exception $$$$$$$$$$$$$$$$
    I checked the classpath, c:\bea is in there!!
    Is any problem for installing and uninstalling a few times on the same computer?
    Thanks a lot!!
    JH

    Hi,
    As mentioned in the following configuration article, for earlier versions of SQL Server where MARS was not an option, the way to configure is to have server-side cursors configured.
    (check out the tabulated column next to MARS_Connection for details)
    http://www.easysoft.com/products/data_access/odbc-sql-server-driver/manual/configuration.html
    To use server-side queries in the connection URL, pls go through this link
    http://www.oracle.com/technology/products/jdev/howtos/bc4j/bc_psqlserverwalkthrough.html
    But please note that server-side cursors does have a performance overhead.
    Let me know if you need more information.
    HTH,
    Lakshmi.

  • I need to create a DSN less connection to an oracle 10g database in coldFusion 10

    Can i use <Cfquery   dbtype =:dynamic Connectstring="">
    if so, where can I get examples of the Connectstring
    if not what other options are available

    I am planning to do my project on Linux with J2EE,Oracle technologies.You don't need to set up a DSN. Just use a JDBC connect string such as jdbc:oracle:thin:@localhost:1521:xe
    ~Jer

  • How to create YTD and MTD reports using Sql Server 2008 r2 report builder 3.0

    Hi All,
    How can I create YTD report from the below data. please help me
    ProdA     ProdB     ProdC     Month     Year
    10       50        40          January      2012
    Data for full Year i.e. from Jan - December 2012
    50       90       100        January       2013
    Data for full Year i.e. from Jan - December 2013
    90       40         30        January        2014
    Data for full Year i.e. from Jan - Till Date 2014
    MercuryMan

    You can use a correlated subquery to calculate YTD in query behind. You can use APPLY operator for that
    so something like
    SELECT *
    FROM Table t1
    CROSS APPLY (SELECT SUM(ProdA) AS TotA,SM(prodB) AS TotB,SUM(prodC) AS TotC
    FROM Table
    WHERE Year = t.Year)t1
    And show TotA,TotB and TotC in the required total row
    Another method is to add required totals in SSRS by clicking on relevant group and choosing Add Total option
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to create ADC in SBS 2008 64 bit Server for SBS 2003 32 bit Server?

    Hi,
    We have single windows SBS 2003 32 bit server with AD to run database as well as application of the Company. We are planning to add one more server to the network with SBS 2008 64 bit for load balancing. I just confused that two SBS servers are not compatible
    in the SBS network. my requirement is to balance the database and application request load balancing along with fail over management with two Servers in the network.
    Please let me know the procedure to add the SBS 2008 64 bit server as Additional Domain Controller to SBS 2003 32 bit PDC so that ADC to take role if PDC fails.
    Any other ways to meet my requirement?

    Hi Mallensh Patil,
    Would you please let us know current situation of this issue?
    I agree with Cliff. Just addition, please also refer to following article and check if can help you.
    Debunking Myths About Additional Domain Controllers In SBS Domains
    If any update, please feel free to let me know.
    Hope this helps.
    Best regards,
    Justin Gu

  • DSN less connection from VB 5?

    Hi all,
    while I could get some information on creating DSN less connections into SQL Server with Visual Basic 5 on the Microsoft site, I could not get these tips to work with our Oracle server (what a surprise).
    Maybe somebody here can tell me what I am doing wrong:
    The Service name of our server in TNSNames is acesa1.cp.chbs
    I have a Dataobject on my form in VB5 and set its connect property like:
    Data1.Connect = "ODBC;DRIVER=Oracle73;UID=user;PWD=password;SERVER=acesa1.cp.chbs"
    I set the recordsource property and do a Data1.Refresh.
    I get error ODBC connection to Oracle73acesa1.cp.chbs failed.
    Obviously there is something wrong.
    Thanks to anybody who can point me to the correct syntax!
    Peter

    Solved my problem already. I was copying the code I use for DSN less connections in Visual Foxpro, but made a typo.
    For all who are interested in the solution, here is the code I use to set the connect property:
    Data1.Connect = "ODBC;DRIVER=Oracle73;UID=userid;PWD=password;DBQ=acesa1.cp.chbs;"
    The important part is the DBQ parameter, SERVER or DATABASE are not used by the Oracle ODBC drivers.
    Sorry for bothering you for nothing,
    Peter

Maybe you are looking for

  • Why is ical on iPhone 5s missing old events only on list view??

    i have the latest ios7 on my iphone 5s.  i only noticed this recently that old events more than 1 year old are missing from ical once i am in list view (magnifying glass) but present on day/week/month view?  On settings it is set to sync all events a

  • Lumia 1020 isn't recognized by Windows 8.1

    I just installed Windows 8.1 and when I plug in my Lumia 1020, it isn't recognized.  In Device Manager it shows up under "Other Devices" as "Nokia Lumia 909 (RM-877)".  I understand that the 909 and the 1020 are the same so no mystery there.  When I

  • Help converting pdf forms to a word document

    Debbie I need help converting a pdf form to a word document.

  • Multiple images in a tiff file

    I have a new scanner which saves several images to the same tiff file, How do I place all the images into an InDesign document and not just the top one?

  • Running SQL developer with Oracle XE

    I am running SQL Developer 1.5 against Oracle 10g XE for a quick interface to practice SQL and PL/SQL. Before running any scripts to create tables, I see a huge number of tables, views, etc. already created for my user HR (which I unlocked in Oracle