You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Took me forever to figure this out because the docs out there for 4D are minimal[^1] on connecting to the database without a system configured DSN using 4D's ODBC driver.
13
13
14
-
Took me forever to figure this out because the docs out there for 4D are minimal.
15
-
16
-
17
-
Easy configuration of multiple data sources is crucial if you want to use CodeIgniter or any other framework that allows configuration files to control the deployment and connection to various databases.
18
-
19
-
20
-
21
-
22
-
|`// get the connection resource``$connect``= odbc_connect(``'DRIVER={4D v11 ODBC Driver};SSL=false;SERVER=192.168.1.100;PORT=19812;UID=user;PWD=password'``,``""``,``""``);`|
23
-
| --- |
14
+
Easy configuration of multiple data sources is crucial if you want to use `CodeIgniter` or any other framework that allows configuration files to control the deployment and connection to various databases.[^2]
24
15
16
+
```php
17
+
// get the connection resource circa 2011 so php ~v5.x 4D's database default port was `19812`
I played with various different ways of doing this connection string, and found the above the most straight forward. You can leave password blank if there isn’t one.
27
22
23
+
Now if only they would make a linux odbc driver...[^3]
28
24
29
-
Now if only they would make a linux odbc driver…
30
-
25
+
## DSN Configuration
31
26
27
+
If I recall correctly our `4D` instance was deployed on a Mac Server and `PHP` a `Windows IIS` server. So the DSN configuration would've had a dialog something like below.
In hindsight one of my more "popular" 4D/technology posts. [2024-05-27 comments screenshot](/assets/posts-images/4d-dsn-less-odbc-connection-comments.png)
43
+
38
44
Initial `md` Generated using [https://github.com/jsr6720/wordpress-html-scraper-to-md](https://github.com/jsr6720/wordpress-html-scraper-to-md)
39
45
40
46
Original Wordpress categories: ['4D']
@@ -47,8 +53,14 @@ Original Wordpress comments: <a href="https://txcowboycoder.wordpress.com/2011/0
47
53
48
54
tags: {{ page.tags | join: ", " }} <!-- todo move this somewhere -->
49
55
50
-
- {{ "2024-05-06 22:47:17" | date_to_string: "ordinal", "US" }} Converted to jekyll markdown format and copied to personal site
56
+
- {{ "2024-05-27 01:13:57 -0400" | date_to_string: "ordinal", "US" }} Came in and updated content testing layout. Added original comments
57
+
- {{ "2024-05-06 22:47:17 -0400" | date_to_string: "ordinal", "US" }} Converted to jekyll markdown format and copied to personal site
51
58
- {{ page.date | date_to_string: "ordinal", "US" }} Originally published on [txcowboycoder wordpress site](https://txcowboycoder.wordpress.com/2011/03/30/4d-dsn-less-odbc-connection/)
52
59
53
60
## EOF/Footnotes
54
61
62
+
[^1]: Happy to report documentation is much more comprehensive now https://doc.4d.com/4Dv20/4D/20/Using-a-connection-string.200-6341904.en.html
63
+
64
+
[^2]: Configuration as code all the way back in 2011!
0 commit comments