Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About ave!

  • Rank
  1. Assuming you want the url of the primary web site for the specified client, the query can be a lot simpler. ExecuteSQL(" SELECT url FROM JoinClientsWebsites LEFT JOIN Websites ON Websites.id = JoinClientsWebsites.id_websites WHERE JoinClientsWebsites.primary = 'yes' AND JoinClientsWebsites.id_clients = ? " ; "" ; "" ; Clients::id ) Where it's possible, use the first table (the one after FROM) to filter results. In FileMaker, it's faster to search by a field of the layout table rather than by a field of a related table, right? It's basically the same thing. Regards, Iwao
  2. Here's the two basic functions to save/load clipboard data to/from a file. You may need to replace '«class XMSC»' with an appropriate class description (see the first post of this topic). It should work on Snow Leopard as well. on saveToFile() -- Read the clipboard data. try set clipboardData to the clipboard as record set xmlData to «class XMSC» of clipboardData on error errMsg number errNum display dialog (localized string "invalidClipboardData") & return & errNum return end try -- Save the clipboard data as XML text file. set destFile to choose file name with prompt (localized string "chooseFileName") try set destRef to open for access destFile with write permission set eof of destRef to 0 write xmlData to destRef starting at eof close access destRef on error try close access destRef end try end try end saveToFile on loadFromFile() set xmlFile to choose file with prompt (localized string "chooseFile") try set srcRef to open for access xmlFile without write permission set xmlData to read srcRef as «class XMSC» close access srcRef set the clipboard to xmlData on error errMsg number errNum try close access srcRef end try display dialog errMsg & return & errNum end try end loadFromFile We have released it as a freeware with minimal UI. http://bit.ly/csd1Wc ..and here's another for those who have Microsoft Excel. http://bit.ly/bQi9FA Hope you find them useful. Cheers! Iwao
  3. No, you cannot execute script via JDBC (or ODBC) with FM 7 or later. FYI, FM PHP API seems to have a way to do this.
  4. Hi, The topic below might help. http://fmforums.com/forum/showtopic.php?tid/183046/ Here's some additional info for setting up JDBC. - How to get FM JDBC client driver. You will find the installer in 'xDBCJDBC Client Driver Installer' folder of your product CD. Double click 'sljcinstaller.jar' to launch installer. Choose 'Install Directory' wherever you want. The client driver 'sljc.jar' is installed in '{INSTALL_DIR}driverlib' folder. - How to publish your database using xDBC. Open 'Define Accounts & Privileges' dialog from file menu. Select 'Privilege Sets' tab. Enable 'Access via ODBC/JDBC (fmxdbc)' for every privilege set you want to allow access. HTH, ave!
  5. Though I do not recommend it, you can use 'GetAs' function to get image data from a container field. SELECT GetAs(your_container_field, 'JPEG') FROM your_table Note that... - You have to know the file type of the image. - You cannot put an image data into a container field. Please read the developer's guide for detail. http://www.filemaker.com/support/product/documentation.html
  6. ave!

    Print Problem?

    It reminded me about this KB article at Microsoft, not sure if it's the same issue though. http://support.microsoft.com/?scid=kb%3Ben-us%3B935843&x=21&y=14 HTH, ave!
  7. Though it seems to be an indispensable feature, you cannot do this in FileMaker ODBC/JDBC, currently. Please submit a feature request. http://www.filemaker.com/company/feature_request.html -- If FileMaker PHP API or FX.php can be your platform, they have corresponding feature, I think.
  8. Actually, it's worse in Japanese locale. I have reported about ten bugs related PreparedStatement and some of them are not fixed yet. Anyway, my workaround for this problem is defining alternative accessor methods in my domain objects. import java.text.*; import java.util.*; public class YourDomain { /* the field you want to insert */ private Double dbl; private NumberFormat nf = NumberFormat.getInstance(Locale.ITALY); /* normal accessors */ public getDbl() { return dbl; } public setDbl(Double dbl) { this.dbl = dbl; } /* getter for FM JDBC */ public getDblStr() { return (this.dbl == null ? "" nf.format(this.dbl)); } } Now you can use this special accessor with PreparedStatement#setString(). PreparedStatement stmt = ...; stmt.setString(yourDomain.getDblStr()); I'm not sure which spring class you are using but I think you can get the basic idea. And, of course, you can have an alternative setter method for retrieving data from database if you need to. It still is tedious but may be better than using normal Statement. Hope this helps, AVE!
  9. You can execute case-insensitive search like below. SELECT * FROM "database_name" WHERE LOWER(field_name) = LOWER(condition) Though I'm not sure if this is what you want, hope this helps.
  10. I do not know anything about Word MailMerge but here's the connection string I use in my application. Provider=MSDASQL.1;Persist Security Info=False;Data Source=YOUR_DSN;User Id=USER_NAME;Password=PASSWORD; Hope this helps.
  11. How about this? 1. Create a database (Untitled.fp7). 2. Create a field. 3. Go to browse mode and create a few records with proper value. 4. Publish the file using ODBC/JDBC protocol. 5. Create a java source (JdbcTest.java). 6. Compile (javac JdbcTest.java). 7. Execute (java -cp .:sljc.jar JdbcTest). -- Contents of JdbcTest.java import java.sql.*; public class JdbcTest { public static void main(String[] args) { try { Class.forName("com.ddtek.jdbc.sequelink.SequeLinkDriver"); // Load driver. Connection con = DriverManager.getConnection( "jdbc:sequelink://;serverdatasource=Untitled", "admin", "" ); // Get connection. final String sql = "select * from Untitled"; Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery(sql); while (rs.next()) { System.out.println("value = " + rs.getString(1)); } con.close(); // Closing connection. } catch ( Exception e ) { e.printStackTrace(); } } } Hope this helps.
  12. There is no such feature unfortunately. Please submit feature request FM Featuer Suggestion You can do this only when no one creates new record using FileMaker client (and it's quite rare situation I think). What I usually do is to use two fields. One for 'primary_key' which is assigned by FM and the other for 'odbc_key'. On insertion I set some calculated unique key (combination of timestamp, ip address, GUID, etc.) as 'odbc_key'. Then I select newly created row using the 'odbc_key' to get assigned 'primary_key'. Hope this helps.
  13. 1. Create new text file with the codes below and name it 'InsertSample.java'. 2. Compile it. [ javac InsertSample.java ] 3. Copy FileMaker JDBC client driver ('sljc.jar') to the same directory. 4. Run it. [ java -cp .:sljc.jar InsertSample ] import java.sql.*; public class InsertSample { public static void main(String[] args) { try { // Load driver. Class.forName("com.ddtek.jdbc.sequelink.SequeLinkDriver"); // Get connection. Connection con = DriverManager.getConnection( "jdbc:sequelink://;serverdatasource=DATABASE_NAME", "admin", "" ); String sql = "INSERT INTO TABLE_NAME (FIELD_NAME) values ('VALUE')"; Statement stmt = con.createStatement(); int result = stmt.executeUpdate(sql); // Closing connection. con.close(); } catch ( Exception e ) { e.printStackTrace(); } } } -- Replace the IP address, DATABASE_NAME, TABLE_NAME and FIELD_NAME as you need. DATABASE_NAME is the name of the filemaker database file without extension. TABLE_NAME and FIELD_NAME should be surrounded with double quotes (some particular words cause parse error). Note that you have to configure the sharing settings of the database to allow some users to access via JDBC. Hope this helps.
  14. Though I'm not sure what you are trying to achieve, Creator 2 wouldn't be what you want. Here's the list of DB servers and JDBC drivers supported by Creator 2 (in case you have not checked yet). http://developers.sun.com/prodtech/javatools/jscreator/reference/docs/2/Installation_ReleaseNotes.html#databaseservers I guess it's 'scrollable result sets' which caused the error but it may be just one of the other unimplemented functions Creator 2 will require. Hope this helps.
  15. There is a note about this problem in the official document named 'Installing FileMaker 7 ODBC and JDBC Client Drivers'. http://www.filemaker.com/downloads/pdf/fm7_odbc_jdbc_install.pdf -- If it doesn't work, try this. It always worked fine for me. 1. With "regedit" program, export the key [HKEY_LOCAL_MACHINESOFTWAREODBCODBCINST.INIODBC Drivers] to a file (e.g. odbc.reg). 2. Delete the key [HKEY_LOCAL_MACHINESOFTWAREODBCODBCINST.INIODBC Drivers] in the registry. Then quit "regedit". 3. Open the exported file with "Notepad" program and delete the following line and save the file. @="" 4. Import the file from "regedit". -- I found it in the MySQL bug tracker. http://bugs.mysql.com/bug.php?id=4303 Hope this helps.
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.